[FFmpeg-user] metadata editing wrong

Jim Worrall coniophora at gmail.com
Sun May 13 20:21:48 CEST 2012


When I ask ffmpeg to change one metadata element in an audio stream, it seems to plan
 to do the right thing, but it ends up altering all the metadata and not doing the one change I want. 
Apparently I don't understand how metadata editing is supposed to work.

Following are the command line, complete output 
(notice the output metadata looks like what I asked for), 
and finally ffmpeg's look at the new file, with the altered metadata.

Thanks for any help,
Jim

$ ffmpeg -ss 300 -i test-in.mkv -t 15 -c:v libx264 \
-vprofile main -preset slower \
-x264opts level=3.1:ref=4:crf=17 \
-c:a libvo_aacenc -ac 2 -async 1 -b:a 192k \
-metadata:s:a title="TESTMETADATA" \
-threads 0 \
test-out.mp4

ffmpeg version 0.10.2.git-e80ce4a Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  7 2012 11:34:49 with clang 3.0 (tags/Apple/clang-211.12)
  configuration: --prefix=/Volumes/Ramdisk/sw --cc=clang --enable-gpl --enable-version3 --arch=x86_64 --enable-hardcoded-tables --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libvo-aacenc --enable-libvpx --enable-libmp3lame --enable-libx264 --enable-libvorbis --enable-libtheora --enable-libspeex --disable-indevs --disable-outdevs --disable-decoder=libvpx --disable-ffserver --disable-network
  libavutil      51. 45.100 / 51. 45.100
  libavcodec     54. 13.100 / 54. 13.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 67.101 /  2. 67.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 10.100 /  0. 10.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, matroska,webm, from 'test-in.mkv':
  Metadata:
    creation_time   : 2012-02-10 02:56:49
  Duration: 02:17:43.07, start: 0.000000, bitrate: 6782 kb/s
    Stream #0:0(chi): Video: h264 (High), yuv420p, 1280x546, SAR 1:1 DAR 640:273, 24 fps, 24 tbr, 1k tbn, 48 tbc
    Metadata:
      title           : White.Vengeance.2011
    Stream #0:1(chi): Audio: ac3, 48000 Hz, 5.1(side), s16, 640 kb/s (default)
    Metadata:
      title           : DD5.1 640K Mandarin
    Stream #0:2(chi): Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s
    Metadata:
      title           : DTS-CORE 1536K Cantonese
ret 1, stream_spec a
[buffer @ 0x7f9a88c19c80] w:1280 h:546 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:flags=2
[libx264 @ 0x7f9a8902b200] using SAR=1/1
[libx264 @ 0x7f9a8902b200] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
[libx264 @ 0x7f9a8902b200] profile Main, level 3.1
[libx264 @ 0x7f9a8902b200] 264 - core 122 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=4 deblock=1:0:0 analyse=0x1:0x131 me=umh subme=9 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=17.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'test-out.mp4':
  Metadata:
    creation_time   : 2012-02-10 02:56:49
    encoder         : Lavf54.3.100
    Stream #0:0(chi): Video: h264 (![0][0][0] / 0x0021), yuv420p, 1280x546 [SAR 1:1 DAR 640:273], q=-1--1, 24 tbn, 24 tbc
    Metadata:
      title           : White.Vengeance.2011
    Stream #0:1(chi): Audio: aac (@[0][0][0] / 0x0040), 48000 Hz, 2 channels, s16, 192 kb/s (default)
    Metadata:
      title           : TESTMETADATA
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (ac3 -> libvo_aacenc)
Press [q] to stop, [?] for help
Input stream #0:1 frame changed from rate:48000 fmt:s16 ch:6 to rate:48000 fmt:s16 ch:2
DTS -5584, next:-1333 st:0 invalid dropping
PTS -5500, next:-1333 invalid dropping st:0
DTS -5542, next:39667 st:0 invalid dropping
PTS -5542, next:39667 invalid dropping st:0
DTS -5500, next:80667 st:0 invalid dropping
PTS -5250, next:80667 invalid dropping st:0
DTS -5459, next:121667 st:0 invalid dropping
PTS -5334, next:121667 invalid dropping st:0
DTS -5417, next:162667 st:0 invalid dropping
PTS -5417, next:162667 invalid dropping st:0
DTS -5334, next:-5334000 st:0 invalid dropping
PTS -5292, next:-5334000 invalid dropping st:0
DTS -5292, next:-5293000 st:0 invalid dropping
PTS -5042, next:-5293000 invalid dropping st:0
DTS -5209, next:-5209000 st:0 invalid dropping
PTS -5209, next:-5209000 invalid dropping st:0
frame=  363 fps=4.6 q=-1.0 Lsize=    6252kB time=00:00:15.00 bitrate=3413.1kbits/s dup=2 drop=134    
video:5888kB audio:352kB global headers:0kB muxing overhead 0.184237%
[libx264 @ 0x7f9a8902b200] frame I:8     Avg QP:13.11  size:112485
[libx264 @ 0x7f9a8902b200] frame P:98    Avg QP:16.60  size: 29988
[libx264 @ 0x7f9a8902b200] frame B:257   Avg QP:19.48  size:  8523
[libx264 @ 0x7f9a8902b200] consecutive B-frames:  2.5%  1.7% 23.1% 72.7%
[libx264 @ 0x7f9a8902b200] mb I  I16..4: 19.6%  0.0% 80.4%
[libx264 @ 0x7f9a8902b200] mb P  I16..4:  2.3%  0.0%  6.4%  P16..4: 45.4% 24.8% 12.8%  0.9%  0.2%    skip: 7.2%
[libx264 @ 0x7f9a8902b200] mb B  I16..4:  0.2%  0.0%  0.7%  B16..8: 50.6% 10.5%  1.9%  direct: 4.7%  skip:31.4%  L0:40.5% L1:46.0% BI:13.4%
[libx264 @ 0x7f9a8902b200] direct mvs  spatial:98.8% temporal:1.2%
[libx264 @ 0x7f9a8902b200] coded y,uvDC,uvAC intra: 82.6% 78.9% 52.1% inter: 18.0% 19.6% 1.3%
[libx264 @ 0x7f9a8902b200] i16 v,h,dc,p: 28% 19% 17% 36%
[libx264 @ 0x7f9a8902b200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20%  7%  6%  9% 12% 12% 10% 11% 12%
[libx264 @ 0x7f9a8902b200] i8c dc,h,v,p: 46% 21% 24%  9%
[libx264 @ 0x7f9a8902b200] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7f9a8902b200] ref P L0: 54.8% 10.4% 20.5% 11.8%  2.4%
[libx264 @ 0x7f9a8902b200] ref B L0: 83.0% 12.8%  4.3%
[libx264 @ 0x7f9a8902b200] ref B L1: 90.1%  9.9%
[libx264 @ 0x7f9a8902b200] kb/s:3188.91

$ ffmpeg -i test-out.mp4
ffmpeg version 0.10.2.git-e80ce4a Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  7 2012 11:34:49 with clang 3.0 (tags/Apple/clang-211.12)
  configuration: --prefix=/Volumes/Ramdisk/sw --cc=clang --enable-gpl --enable-version3 --arch=x86_64 --enable-hardcoded-tables --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libvo-aacenc --enable-libvpx --enable-libmp3lame --enable-libx264 --enable-libvorbis --enable-libtheora --enable-libspeex --disable-indevs --disable-outdevs --disable-decoder=libvpx --disable-ffserver --disable-network
  libavutil      51. 45.100 / 51. 45.100
  libavcodec     54. 13.100 / 54. 13.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 67.101 /  2. 67.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 10.100 /  0. 10.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test-out.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2012-02-10 02:56:49
    encoder         : Lavf54.3.100
  Duration: 00:00:15.12, start: 0.000000, bitrate: 3386 kb/s
    Stream #0:0(chi): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x546 [SAR 1:1 DAR 640:273], 3189 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc
    Metadata:
      creation_time   : 2012-02-10 02:56:49
      handler_name    : VideoHandler
    Stream #0:1(chi): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 192 kb/s
    Metadata:
      creation_time   : 2012-02-10 02:56:49
      handler_name    : SoundHandler
At least one output file must be specified


More information about the ffmpeg-user mailing list