Adds an asset track (for example, subtitles, or an alternate audio track) to an asset.
curl https://api.mux.com/video/v1/assets/${ASSET_ID}/tracks \
-X POST \
-d '{ "url": "https://example.com/myVIdeo_en.srt", "type": "text", "text_type": "subtitles", "closed_captions": true, "language_code": "en-US", "name": "English", "passthrough": "English" }' \
-H "Content-Type: application/json" \
-u ${MUX_TOKEN_ID}:${MUX_TOKEN_SECRET}
The URL of the file that Mux should download and use.
audio
tracks, the URL is the location of the audio file for Mux to download, for example an M4A, WAV, or MP3 file. Mux supports most audio file formats and codecs, but for fastest processing, you should use standard inputs wherever possible.text
tracks, the URL is the location of subtitle/captions file. Mux supports SubRip Text (SRT) and Web Video Text Tracks formats for ingesting Subtitles and Closed Captions.The language code value must be a valid BCP 47 specification compliant value. For example, en for English or en-US for the US version of English.
The name of the track containing a human-readable description. This value must be unique within each group of text
or audio
track types. The HLS manifest will associate the text
or audio
track with this value. For example, set the value to "English" for subtitles text track with language_code
as en-US. If this parameter is not included, Mux will auto-populate a value based on the language_code
value.
Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH).
Arbitrary user-supplied metadata set for the track either when creating the asset or track.
The asset ID.
{
"url": "https://example.com/myVideo_en.srt",
"type": "text",
"text_type": "subtitles",
"language_code": "en-US",
"name": "English",
"closed_captions": true,
"passthrough": "English"
}
{
"data": {
"type": "text",
"text_type": "subtitles",
"status": "preparing",
"passthrough": "English",
"name": "English",
"language_code": "en-US",
"id": "xBe7u01029ipxBLQhYzZCJ1cke01zCkuUsgnYtH0017nNzbpv2YcsoMDmw",
"closed_captions": true
}
}