Opened 4 years ago

Last modified 2 years ago

#6103 new defect

When trying to set the audio track metadata language to 'und' (undefined) ffmpeg switches to 'eng' (English)

Reported by: vsanchez Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: metadata
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:

When trying to set the audio track metadata language to 'und' (undefined) ffmpeg switches to 'eng' (English). However, according to ISO639-2 specs, the string 'und' is supported.

How to reproduce:

% ffmpeg -i <VIDEO_FILE> -i <AUDIO_FILE> -c:v copy -map 0:a -metadata:s:a:0 language=und -metadata:s:a:0 title="Undetermined" -y
ffmpeg version
built on ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (8)

comment:1 Changed 4 years ago by vsanchez

Probably there is no need to include a second file.

Better use this command:

ffmpeg -i <VIDEO_FILE> -c:v copy -metadata:s:a:0 language=und -metadata:s:a:0 title="Undetermined" -y

Thank you for the good work.

comment:2 Changed 4 years ago by cehoyos

  • Component changed from ffmpeg to undetermined
  • Keywords iso639-2 removed

Please test current FFmpeg git head and provide the command line that allows to reproduce the issue together with the complete, uncut console output to make this a valid ticket.

comment:3 Changed 2 years ago by peter_b

Just ran into the same thing.
btw: This issue also affects other "less common" ISO639-2 codes like "qaa-qtz (=Reserved for local use)" or "zxx (=No linguistic content)" for example.

Here's a commandline and the complete, uncut console output for reproduction:

$ ffmpeg -y -f lavfi -i "sine=frequency=1000:duration=1" -c:a pcm_s16le -metadata:s:a:0 language=und
ffmpeg version N-92314-g323c2cf Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --prefix=/usr/local --enable-gpl --enable-nonfree --enable-version3 --enable-postproc --enable-ffplay --enable-swscale --enable-avfilter --enable-pthreads --enable-bzlib --enable-zlib --enable-decoder=png --enable-encoder=png --samples=../fate-suite --enable-libfreetype --enable-libopenjpeg --disable-decoder=jpeg2000 --enable-libvpx --enable-libvorbis --enable-libx264 --enable-libx265
  libavutil      56. 21.100 / 56. 21.100
  libavcodec     58. 34.100 / 58. 34.100
  libavformat    58. 19.102 / 58. 19.102
  libavdevice    58.  4.106 / 58.  4.106
  libavfilter     7. 39.100 /  7. 39.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, lavfi, from 'sine=frequency=1000:duration=1':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, mov, to '':
    encoder         : Lavf58.19.102
    Stream #0:0(und): Audio: pcm_s16le (sowt / 0x74776F73), 44100 Hz, mono, s16, 705 kb/s
      encoder         : Lavc58.34.100 pcm_s16le
[Parsed_sine_0 @ 0x3aec580] EOF timestamp not reliable
size=      87kB time=00:00:01.00 bitrate= 711.1kbits/s speed= 150x    
video:0kB audio:86kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.777778%

Reading the resulting file shows "eng" (English) instead of "und" (Undetermined)

$ ffprobe-git -loglevel quiet -show_entries stream=index,codec_name,codec_type:stream_tags=language -i
Version 0, edited 2 years ago by peter_b (next)

comment:4 Changed 2 years ago by peter_b

btw: In order to rule out syntax issues, I've also tested it with "language=ger" (German) and "language=fra" (French). These languages work as expected.

comment:5 Changed 2 years ago by Gyan

For MOV, FFmpeg restricts itself to the Macintosh Script Manager codes. ISO639-2 isn't used. There is a valid code for Undeclared (0x7FFF) which isn't implemented.

comment:6 Changed 2 years ago by peter_b

I'm surprised to hear that, because from a quick look at libavformat/isom.c, I thought that the static codes-table is deprecated and replaced by ISO639-2 stored in 3*5 bits ASCII (as written in MOV-specs):

/* map numeric codes from mdhd atom to ISO 639 */
/* cf. QTFileFormat.pdf p253, qtff.pdf p205 */
/* */
/* deprecated by putting the code as 3*5 bits ASCII */
Last edited 2 years ago by peter_b (previous) (diff)

comment:7 Changed 2 years ago by Gyan

See the code in the fn below, before the 3*5 is returned.

    if (!mp4)
return -1;

comment:8 Changed 2 years ago by peter_b

Oooooh... :(

Why is that so?

Note: See TracTickets for help on using tickets.