A track insertion transform adds a subtitle or audio track to an existing Video on Demand (VOD) asset. It also updates the asset’s client and server manifests with the new track.
Create track insertion transforms through the Media API. The MK.IO portal does not create this transform type.
Track side-loading is only available for MP4 content.
Set the preset’s @odata.type to #MediaKind.TrackInserterPreset. Each transform output can insert one text or audio track.
If clients requested the manifest shortly before insertion, caching can delay the updated manifest by a couple of minutes.
Configuration parameters
Section titled “Configuration parameters”The following parameters configure the inserted track:
Parameter | Description |
|---|---|
@odata.type | Use |
trackName | The name of the track as it will appear in the manifest. |
hlsSettings | The HLS specific setting for the track. The attributes for this object are described in a separate table. |
dashSettings | The DASH settings for the track. Only available for audio tracks. The attributes for this object are described in a separate table. |
languageCode | The language code for the track. The value is an RFC5646 language code. |
displayName | The display name of the track on a video player. In HLS, this maps to the NAME attribute of EXT-X-MEDIA. |
playerVisibility | Set |
HLS specific settings
Section titled “HLS specific settings”Parameter | Description |
|---|---|
characteristics | The characteristics of the track as they appear in the HLS playlist.
For subtitles, provide a comma-separated string containing |
default | Indicates whether the HLS playlist marks this track as the default. A value of |
forced | Indicates whether the HLS playlist marks this track as essential for playback. A value of |
DASH settings for audio tracks
Section titled “DASH settings for audio tracks”Parameter | Description |
|---|---|
role | The role of the audio track in the DASH manifest. Provide a comma-separated string containing |
Transform example
Section titled “Transform example”The following transform shows how to use these parameters.
Once the transform is in place, it can be used to create a job on a given VOD asset.
Add a subtitle track to a VOD asset
Section titled “Add a subtitle track to a VOD asset”The following transform adds an English VTT subtitle track for viewers who are deaf or hard of hearing.
curl --request PUT \ --url https://app.mk.io/api/v1/projects/project_name/media/transforms/transform_name \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'Authorization: Bearer bearer-token' \ --data '{ "properties": { "outputs": [ { "preset": { "@odata.type": "#MediaKind.TrackInserterPreset", "tracks": [ { "@odata.type": "#MediaKind.TextTrack", "trackName": "subtitle_en_US", "displayName": "eng (hearing-impaired)", "hlsSettings": { "characteristics": "public.accessibility.describes-music-and-sound" }, "languageCode": "en-US" } ] } } ] }}'Add an audio track to a VOD asset
Section titled “Add an audio track to a VOD asset”The following transform adds a secondary audio track to VOD content.
curl --request PUT \ --url https://app.mk.io/api/v1/projects/project_name/media/transforms/transform_name \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --header 'Authorization: Bearer bearer-token' \ --data '{ "properties": { "outputs": [ { "preset": { "@odata.type": "#MediaKind.TrackInserterPreset", "tracks": [ { "@odata.type": "#MediaKind.AudioTrack", "trackName": "ai-generated-fr-audio", "displayName": "fra", "languageCode": "fr-FR", "hlsSettings": { "characteristics": "public.machine-generated" }, "dashSettings": { "role": "dub" } } ] } } ] }}'