Imgix APIsVideo APISubtitlesSubtitle Source Language

Subtitle Source Language

video-subtitle-lang

Beta Feature

This feature is currently in beta. To request access, please contact your account manager or email support@imgix.com.

Forces a specific source language for AI transcription instead of using automatic language detection. Also used to tag the language of a provided subtitle track when using bring-your-own subtitles.

video-subtitle-lang accepts a valid ISO 639-1 or ISO 639-2 language code.

With AI Transcription

By default, video-generate-subtitles automatically detects the spoken language in the audio. Use video-subtitle-lang to override this and specify the language explicitly.

https://assets.imgix.net/video.mp4?fm=hls&video-generate-subtitles=true&video-subtitle-lang=es

Forcing the source language is useful when:

  • Auto-detection produces inaccurate results for a specific language or accent
  • The audio contains a single known language and you want to skip the detection step
  • The language has limited auto-detection support in the transcription engine

This parameter requires video-generate-subtitles to be set when used for transcription. It controls the transcription source language, not the output language. To deliver subtitles in other languages, use video-subtitle-translations.

With Bring-Your-Own Subtitles

When providing your own subtitle file via video-subtitle-src, use video-subtitle-lang to tag the language of that track. Use the indexed form video-subtitle-lang[N] to match the corresponding video-subtitle-src[N].

https://assets.imgix.net/videos/girl-reading-book-in-library.mp4?fm=hls
  &video-subtitle-src[0]=https%3A%2F%2Fexample.com%2Fen.vtt
  &video-subtitle-lang[0]=en
  &video-subtitle-src[1]=https%3A%2F%2Fexample.com%2Fes.vtt
  &video-subtitle-lang[1]=es

The language tag is embedded in the manifest’s LANGUAGE attribute and surfaces in media player subtitle menus.

video-caption-lang is accepted as an alias for video-subtitle-lang.

Live Demo

The player below uses video-subtitle-lang=en to explicitly specify English as the transcription language rather than relying on auto-detection. Enable subtitles using the CC/subtitles button in your browser’s video player controls.