<pre><code>-map 0:v \
-map 0:1 -metadata:s:a:0 language=zxx \
-map 0:2 -metadata:s:a:1 language=eng \
-map 0:3 -metadata:s:a:2 language=fra \
-map 0:4 -metadata:s:a:3 language=kin
</code></pre>

CC BY-SA 4.0
2021-12-01T13:16:59.430Z
The original poster asked how to add an 'Undefined language', not english, french, etc.
v010dya
CC BY-SA 4.0
2019-09-03T14:26:59.180Z
2020-01-07T22:24:24.797Z
2020-01-07T22:24:24.797Z
Javier Ramos Saralegui
<p>I have to transcode with FFMpeg some video with multiple audio where various audio track are not language related, just music and so on.</p>

<p>I would like to assing as language something like Unspecified, Unknown, Not Applicable, Multilanguage, or so on.</p>

<p>Everything that is not a specific named language (English, French, Spanish, ...) works fine for me .</p>

<pre><code>ffmpeg -i in.mov -map 0:a -metadata:s:a:0 language="und" -metadata:s:a:0 title="Just Music" out.mov
</code></pre>

<p>For what I researched FFMPeg uses the ISO 639-2 codes:</p>

<p><a href="https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes</a></p>

<p>In my example I tried to use the <strong>und</strong> that stands for Undetermined..</p>

<p>In the wikipedia list there are also other possible interesting options:</p>

<pre><code>The standard includes some codes for special situations:

    mis, for "uncoded languages";
    mul, for "multiple languages";
    qaa-qtz, a range reserved for local use.
    und, for "undetermined";
    zxx, for "no linguistic content, not applicable";
</code></pre>

<p>Non of them seems to work, everytime I try to set that values with ffmpeg it just assume "English".</p>

<p>Following the Apple Documentation for Moov Format we have:</p>

<p><a href="https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-34353" rel="nofollow noreferrer">https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-34353</a></p>

<p>A very small list compared to the Wikipedia one but there's at least a <strong>Unspecified 32767</strong></p>

<p>I tried with <code>-metadata:s:a:0 language="und"</code> or <code>-metadata:s:a:0 language="32767"</code> but is not working the same :(</p>

<p>So I tried to read the source code of ffmpeg, at <strong>ffmpeg/libavformat/isom.c</strong> line <strong>382</strong>:</p>

<pre><code>/* map numeric codes from mdhd atom to ISO 639 */
/* cf. QTFileFormat.pdf p253, qtff.pdf p205 */
/* http://developer.apple.com/documentation/mac/Text/Text-368.html */
/* deprecated by putting the code as 3*5 bits ASCII */
static const char mov_mdhd_language_map[][4] = {
    /* 0-9 */
    "eng", "fra", "ger", "ita", "dut", "sve", "spa", "dan", "por", "nor",
    "heb", "jpn", "ara", "fin", "gre", "ice", "mlt", "tur", "hr "/*scr*/, "chi"/*ace?*/,
    "urd", "hin", "tha", "kor", "lit", "pol", "hun", "est", "lav",    "",
    "fo ",    "", "rus", "chi",    "", "iri", "alb", "ron", "ces", "slk",
    "slv", "yid", "sr ", "mac", "bul", "ukr", "bel", "uzb", "kaz", "aze",
    /*?*/
    "aze", "arm", "geo", "mol", "kir", "tgk", "tuk", "mon",    "", "pus",
    "kur", "kas", "snd", "tib", "nep", "san", "mar", "ben", "asm", "guj",
    "pa ", "ori", "mal", "kan", "tam", "tel",    "", "bur", "khm", "lao",
    /*                   roman? arabic? */
    "vie", "ind", "tgl", "may", "may", "amh", "tir", "orm", "som", "swa",
    /*==rundi?*/
       "", "run",    "", "mlg", "epo",    "",    "",    "",    "",    "",
    /* 100 */
       "",    "",    "",    "",    "",    "",    "",    "",    "",    "",
       "",    "",    "",    "",    "",    "",    "",    "",    "",    "",
       "",    "",    "",    "",    "",    "",    "",    "", "wel", "baq",
    "cat", "lat", "que", "grn", "aym", "tat", "uig", "dzo", "jav"
};

int ff_mov_iso639_to_lang(const char lang[4], int mp4)
{
    int i, code = 0;

    /* old way, only for QT? */
    for (i = 0; lang[0] &amp;&amp; !mp4 &amp;&amp; i &lt; FF_ARRAY_ELEMS(mov_mdhd_language_map); i++) {
        if (!strcmp(lang, mov_mdhd_language_map[i]))
            return i;
    }
    /* XXX:can we do that in mov too? */
    if (!mp4)
        return -1;
    /* handle undefined as such */
    if (lang[0] == '\0')
        lang = "und";
    /* 5 bits ASCII */
    for (i = 0; i &lt; 3; i++) {
        uint8_t c = lang[i];
        c -= 0x60;
        if (c &gt; 0x1f)
            return -1;
        code &lt;&lt;= 5;
        code |= c;
    }
    return code;
}
</code></pre>

<p>They talk of "und" inside the code, but if you use -metadata:s:a:0 language="und" it just return English.. :\</p>

<p>What is the correct way to specify it? It could be a ffmpeg bug? I'm using the last zeranoe nightly build N-92405-ge24a754916</p>

CC BY-SA 4.0
2018-11-12T06:00:20.520Z
At the time the code was written, the ref the devconsulted did not list a value for `und` so it's not accepted. Will patch it soon.
Gyan
CC BY-SA 4.0
2018-11-12T08:30:06.670Z
@Gyan So the ffmpeg should be updated? Thanks :)

Isn't it possible to add also mis, mul and zxx languages as wikipedia suggest?

Would be cool also an "int" for International.. it would make very sense for some kind of tracks like international tracks (eg. Music and Effects)
user3450548
CC BY-SA 4.0
2018-11-12T08:38:03.613Z
Ok, will look into it.
Gyan
<ffmpeg><transcoding><metadata>
FFMpeg set language as Unknown or unspecified in a QuickTime MOV
user3450548
# FFMpeg set language as Unknown or unspecified in a QuickTime MOV

(Asked by: username_0 on 2018-11-11)

I have to transcode with FFMpeg some video with multiple audio where various audio track are not language related, just music and so on.
I would like to assing as language something like Unspecified, Unknown, Not Applicable, Multilanguage, or so on.
Everything that is not a specific named language (English, French, Spanish, ...) works fine for me .
ffmpeg -i in.mov -map 0:a -metadata:s:a:0 language="und" -metadata:s:a:0 title="Just Music" out.mov

For what I researched FFMPeg uses the ISO 639-2 codes:
https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
In my example I tried to use the und that stands for Undetermined..
In the wikipedia list there are also other possible interesting options:
The standard includes some codes for special situations:

    mis, for "uncoded languages";
    mul, for "multiple languages";
    qaa-qtz, a range reserved for local use.
    und, for "undetermined";
    zxx, for "no linguistic content, not applicable";

Non of them seems to work, everytime I try to set that values with ffmpeg it just assume "English".
Following the Apple Documentation for Moov Format we have:
https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-34353
A very small list compared to the Wikipedia one but there's at least a Unspecified 32767
I tried with -metadata:s:a:0 language="und" or -metadata:s:a:0 language="32767" but is not working the same :(
So I tried to read the source code of ffmpeg, at ffmpeg/libavformat/isom.c line 382:
/* map numeric codes from mdhd atom to ISO 639 */
/* cf. QTFileFormat.pdf p253, qtff.pdf p205 */
/* http://developer.apple.com/documentation/mac/Text/Text-368.html */
/* deprecated by putting the code as 3*5 bits ASCII */
static const char mov_mdhd_language_map[][4] = {
    /* 0-9 */
    "eng", "fra", "ger", "ita", "dut", "sve", "spa", "dan", "por", "nor",
    "heb", "jpn", "ara", "fin", "gre", "ice", "mlt", "tur", "hr "/*scr*/, "chi"/*ace?*/,
    "urd", "hin", "tha", "kor", "lit", "pol", "hun", "est", "lav",    "",
    "fo ",    "", "rus", "chi",    "", "iri", "alb", "ron", "ces", "slk",
    "slv", "yid", "sr ", "mac", "bul", "ukr", "bel", "uzb", "kaz", "aze",
    /*?*/
    "aze", "arm", "geo", "mol", "kir", "tgk", "tuk", "mon",    "", "pus",
    "kur", "kas", "snd", "tib", "nep", "san", "mar", "ben", "asm", "guj",
    "pa ", "ori", "mal", "kan", "tam", "tel",    "", "bur", "khm", "lao",
    /*                   roman? arabic? */
    "vie", "ind", "tgl", "may", "may", "amh", "tir", "orm", "som", "swa",
    /*==rundi?*/
       "", "run",    "", "mlg", "epo",    "",    "",    "",    "",    "",
    /* 100 */
       "",    "",    "",    "",    "",    "",    "",    "",    "",    "",
       "",    "",    "",    "",    "",    "",    "",    "",    "",    "",
       "",    "",    "",    "",    "",    "",    "",    "", "wel", "baq",
    "cat", "lat", "que", "grn", "aym", "tat", "uig", "dzo", "jav"
};

int ff_mov_iso639_to_lang(const char lang[4], int mp4)
{
    int i, code = 0;

    /* old way, only for QT? */
    for (i = 0; lang[0] && !mp4 && i < FF_ARRAY_ELEMS(mov_mdhd_language_map); i++) {
        if (!strcmp(lang, mov_mdhd_language_map[i]))
            return i;
    }
    /* XXX:can we do that in mov too? */
    if (!mp4)
        return -1;
    /* handle undefined as such */
    if (lang[0] == '\0')
        lang = "und";
    /* 5 bits ASCII */
    for (i = 0; i < 3; i++) {
        uint8_t c = lang[i];
        c -= 0x60;
        if (c > 0x1f)
            return -1;
        code <<= 5;
        code |= c;
    }
    return code;
}

They talk of "und" inside the code, but if you use -metadata:s:a:0 language="und" it just return English.. :\
What is the correct way to specify it? It could be a ffmpeg bug? I'm using the last zeranoe nightly build N-92405-ge24a754916

**Tags:** ffmpeg, transcoding, metadata

> **Comments:**
> **username_1**: At the time the code was written, the ref the devconsulted did not list a value for `und` so it's not accepted. Will patch it soon.  
> **username_0**: @username_1 So the ffmpeg should be updated? Thanks :)  Isn't it possible to add also mis, mul and zxx languages as wikipedia suggest?  Would be cool also an "int" for International.. it would make very sense for some kind of tracks like international tracks (eg. Music and Effects)  
> **username_1**: Ok, will look into it.  

---

## 1 answers

### Answer by username_2 on 2019-09-03. Score: -1

-map 0:v \
-map 0:1 -metadata:s:a:0 language=zxx \
-map 0:2 -metadata:s:a:1 language=eng \
-map 0:3 -metadata:s:a:2 language=fra \
-map 0:4 -metadata:s:a:3 language=kin

> **Comments:**
> **username_3**: The original poster asked how to add an 'Undefined language', not english, french, etc.  

---

