Add audio tracks to a video¶
Alternate audio tracks let one video carry multiple languages (dubs), an accessibility track, or an extra such as a director's commentary. Viewers pick the track from the player's settings menu.
Uploading alternate audio tracks¶
Adding alternate audio tracks is not yet possible through the GUI.
Use the "Upload audio track" ⧉ endpoint, a multipart form with three fields:
| Field | Meaning |
|---|---|
file | The audio file, at most 100 MB. Any common audio format works; the file is probed and rejected only if it contains no audio stream. |
title | The track's label shown to viewers in the player (up to 64 characters). |
lang_code | The track's language as a BCP 47 code (e.g. en, pt-BR). |
Prerequisites and behavior¶
- The video must already be playable (processed); otherwise the request fails with
422 video_not_ready. Audio tracks can't be added to a fast clip. - Upload audio that matches the video's duration: a longer file is cut to the video's length.
- The track encodes asynchronously. Its
statusstarts atqueued, becomesreadywhen it's playable, orerroredif the encode fails for good. - Uploaded tracks have
type: alternate; the video's own audio is theembeddedtrack. Alternate tracks keep a downloadableoriginal_link. - Auto-generated captions are per audio track: pass an alternate track's id to the caption endpoint to caption that track. Deleting an audio track also deletes the captions generated from it. See auto-generated captions.