Skip to main content

Set Language From Title

FFmpeg Builder: Set Language From Title

This flow element looks for any audio or subtitle tracks that have no language code set, and attempts to work out the language from the track's title. If a language is found, the track's language is set to the ISO 639-2 language code for that language.

This is useful for files that have lost their language tags but still have the language in their track titles, for example a track titled English / AC3 / 5.1 will have its language set to eng.

Tracks that already have a language set are skipped. A track with the language und (undetermined) is treated as having no language.

Type​

The type of tracks that should be updated

TypeDescription
AudioOnly audio tracks are updated
SubtitleOnly subtitle tracks are updated
Audio and SubtitleBoth audio and subtitle tracks are updated

How the Language is Found​

  1. If the entire title is a language, it is used. This can be a language name, an ISO 639-2 code, or an ISO 639-1 code, e.g. English, eng or en.
  2. Otherwise the title is split into words, and each word (or group of words) is checked against the known language names, in English, the language's native name, French and German. Longer matches are checked first, so Chinese Traditional is matched before Chinese.
  3. Three letter ISO 639-2 codes are also matched inside a title, e.g. JPN / FLAC / Stereo.
note

Two letter ISO 639-1 codes are only matched when they are the entire title. Inside a larger title they are too ambiguous, for example HI (hearing impaired) is also the code for Hindi.

Common track title words that are also language codes, such as SSA or ALT, are ignored.

Examples​

TitleLanguage
Englisheng
eneng
English / AC3 / 5.1eng
French (Forced)fre
SDH Englisheng
Deutsch / DTS-HD MA / 7.1deu
Españolspa
日本語jpn
Chinese Traditionalzht
JPN / FLAC / Stereojpn
Commentarynot set
AC3 / 5.1not set

Outputs​

  1. One or more tracks had their language set from their title
  2. No tracks were updated