[FFmpeg-user] proper metadata key=value for default/nondefault subtitles

Jim Worrall coniophora at gmail.com
Tue Oct 30 00:55:47 CET 2012


I'm trying to set some subtitle metadata in a file: 
the language and whether the subtitle should be on by default.  
The language is working fine (although it is interesting that it is not listed 
in the output as metadata, but some other stream character).

But how to set whether the stream is on by default?  The  subtitle stream has
the default flag, and ffmpeg recognizes it.  I've tried to turn it off with
default=0, default=no, with and without quotes, 
default-flag, flag-default.  Whatever I've tried just gets listed as a 
metadata item, but doesn't change the actual attribute as listed on the 
Stream # line.  Does anyone know the proper key and value, or whether
it is even possible in ffmpeg?
Thanks

Here is a typical failed example:

$ ffmpeg -i in.mkv -c copy -metadata:s:s:0 language=eng -metadata:s:s:0 default-flag=0 out.mkv

ffmpeg version N-46127-g7d1e003 Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct 29 2012 06:16:44 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Volumes/Ramdisk/sw --enable-nonfree --enable-gpl --arch=x86_64 --enable-hardcoded-tables --enable-libvo-aacenc --enable-version3 --enable-libmp3lame --enable-libx264 --enable-libvorbis --enable-libgsm --enable-avfilter --enable-filters --enable-libtheora --enable-libspeex --disable-indevs --disable-outdevs --disable-ffserver --disable-network
  libavutil      52.  1.100 / 52.  1.100
  libavcodec     54. 69.100 / 54. 69.100
  libavformat    54. 35.100 / 54. 35.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 20.106 /  3. 20.106
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
Input #0, matroska,webm, from 'in.mkv':
  Metadata:
    ENCODER         : Lavf54.35.100
  Duration: 00:00:13.16, start: 0.000000, bitrate: 4908 kb/s
    Stream #0:0: Video: h264 (High), yuv420p, 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), s16, 448 kb/s (default)
    Stream #0:2: Subtitle: subrip (default)  <----------------------------
Output #0, matroska, to 'out.mkv':
  Metadata:
    encoder         : Lavf54.35.100
    Stream #0:0: Video: h264, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 1k tbn, 1k tbc (default)
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), 448 kb/s (default)
    Stream #0:2(eng): Subtitle: subrip (default)  <----------------------------
    Metadata:
      default-flag    : 0   <----------------------------
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame=  288 fps=0.0 q=-1.0 Lsize=    7887kB time=00:00:12.01 bitrate=5376.0kbits/s    
video:7231kB audio:651kB subtitle:0 global headers:0kB muxing overhead 0.071516%


More information about the ffmpeg-user mailing list