Perform side-loading of subtitle files or other type of tracks to an existing VOD asset.
Track insertion transforms are created using the transform endpoint in MK.IO API.
Track side-loading is only available for MP4 content.
Track insertion preset must use the #MediaKind.TrackInserterPreset value for @data.type attribute.
If the manifest has been played recently before inserting a subtitle track, there may be a delay of a couple of minutes before the manifest is served with the new subtitles, due to caching.
Configuration parameters
Section titled “Configuration parameters”The following table lists the configuration parameters for the VTT side-loading:
Parameter | Description |
|---|---|
@odata.type | Only subtitle track addition is supported for now and the following value must be used: |
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 | When playerVisibilityis set to |
HLS specific settings
Section titled “HLS specific settings”Parameter | Description |
|---|---|
characteristics | The characteristics of the track as it will appear in the HLS playlist.
For subtitles, a comma separated string of |
default | A boolean indicating whether this track should be marked as a default track in the HLS playlist.
If value is |
forced | A boolean indicating whether this track should be marked as a essential for playback in the HLS playlist.
If value is |
DASH specific settings (for audio tracks only)
Section titled “DASH specific settings (for audio tracks only)”Parameter | Description |
|---|---|
role | The role of the track as it will appear in the DASH manifest.
For audio, a comma separated string of |
Transform example
Section titled “Transform example”Below is a sample transform that illustrates 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”Below is a sample transform that will add an English hearing-impaired VTT subtitle track.
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”Below is a sample transform that will add a secondary audio to a 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" } } ] } } ] }}'