[FFmpeg-devel] -vf copy does transcode rather than copy

David Favor david at davidfavor.com
Thu Oct 31 18:28:03 CET 2013


Maybe I'm missing something.

The copy filter states...

    http://ffmpeg.org/ffmpeg-filters.html#copy
    Copy the input source unchanged to the output. Mainly useful for testing purposes.

Test case below shows input video bitrate is 938 kb/s output video bitrate is 836 kb/s
and ffmpeg output shows libx264 is transcoding.

Looks like a bug.
_______

David-Favor-iMac# fftest
+ in=broken.mp4
+ out=vfcopy.mp4
+ ffmpeg -i broken.mp4
+ egrep 'Duration|Stream'

   Duration: 00:42:19.96, start: 0.000000, bitrate: 938 kb/s <<<<<< INPUT VIDEO BITRATE

     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x406 [SAR 64757:64800 DAR 319:180], 810 kb/s, 23.98 fps, 23.98 tbr, 23976 
tbn, 47.95 tbc (default)
     Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 122 kb/s (default)
+ ffmpeg -y -i broken.mp4 -c:a copy -vf copy -vf setdar=dar=0 -vf setsar=sar=0 -t 10 vfcopy.mp4
ffmpeg version 2.1.0-2013-10-31-57660-g49287bb Copyright (c) 2000-2013 the FFmpeg developers
   built on Oct 31 2013 08:52:34 with gcc 4.8.2 (MacPots gcc48 4.8.2_0)
   configuration: --prefix=/david-favor-tools/osx-10.9 --enable-pic --enable-gpl --disable-debug --extra-cflags='-I 
/david-favor-tools/osx-10.9/include -I /opt/local/include' --extra-ldflags='-Wl,-rpath,/david-favor-tools/osx-10.9/lib -Wl,-rpath,/opt/local/lib -L 
/david-favor-tools/osx-10.9/lib -L /opt/local/lib' --enable-version3 --enable-shared --disable-static --enable-ffplay --enable-ffprobe 
--enable-ffserver --enable-runtime-cpudetect --enable-nonfree --enable-zlib --enable-bzlib --enable-openssl --enable-libmp3lame --enable-libfaac 
--enable-libvpx --enable-libtheora --enable-libvorbis --enable-libxvid --enable-libopus --enable-libopenjpeg --enable-libfreetype --enable-libx264 
--enable-postproc --enable-frei0r --enable-libopencore-amrnb --enable-libmodplug --enable-libass --enable-openssl
   libavutil      52. 48.100 / 52. 48.100
   libavcodec     55. 39.100 / 55. 39.100
   libavformat    55. 19.104 / 55. 19.104
   libavdevice    55.  5.100 / 55.  5.100
   libavfilter     3. 90.100 /  3. 90.100
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
   libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'broken.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : muxer
   Duration: 00:42:19.96, start: 0.000000, bitrate: 938 kb/s
     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x406 [SAR 64757:64800 DAR 319:180], 810 kb/s, 23.98 fps, 23.98 tbr, 23976 
tbn, 47.95 tbc (default)
     Metadata:
       handler_name    : VideoHandler
     Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 122 kb/s (default)
     Metadata:
       handler_name    : SoundHandler
[libx264 @ 0x7fcf3b80c400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x7fcf3b80c400] profile High, level 3.0
[libx264 @ 0x7fcf3b80c400] 264 - core 138 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 
fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 
bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 
rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'vfcopy.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf55.19.104
     Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 720x406, q=-1--1, 11988 tbn, 23.98 tbc (default)
     Metadata:
       handler_name    : VideoHandler
     Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 122 kb/s (default)
     Metadata:
       handler_name    : SoundHandler
Stream mapping:
   Stream #0:0 -> #0:0 (h264 -> libx264)
   Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  240 fps=136 q=-1.0 Lsize=    1022kB time=00:00:10.00 bitrate= 836.9kbits/s
video:847kB audio:167kB subtitle:0 global headers:0kB muxing overhead 0.774209%
[libx264 @ 0x7fcf3b80c400] frame I:4     Avg QP:21.50  size: 24760
[libx264 @ 0x7fcf3b80c400] frame P:96    Avg QP:23.29  size:  6498
[libx264 @ 0x7fcf3b80c400] frame B:140   Avg QP:25.55  size:  1028
[libx264 @ 0x7fcf3b80c400] consecutive B-frames: 10.4% 32.5%  8.8% 48.3%
[libx264 @ 0x7fcf3b80c400] mb I  I16..4:  8.3% 73.5% 18.2%
[libx264 @ 0x7fcf3b80c400] mb P  I16..4:  3.0%  8.8%  1.1%  P16..4: 43.0% 15.5%  8.6%  0.0%  0.0%    skip:20.1%
[libx264 @ 0x7fcf3b80c400] mb B  I16..4:  0.1%  0.1%  0.0%  B16..8: 40.4%  2.3%  0.2%  direct: 0.8%  skip:56.0%  L0:41.1% L1:52.6% BI: 6.4%
[libx264 @ 0x7fcf3b80c400] 8x8 transform intra:69.3% inter:72.5%
[libx264 @ 0x7fcf3b80c400] coded y,uvDC,uvAC intra: 46.1% 48.0% 12.8% inter: 13.1% 14.4% 0.2%
[libx264 @ 0x7fcf3b80c400] i16 v,h,dc,p: 32% 16%  9% 43%
[libx264 @ 0x7fcf3b80c400] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 16% 25%  4%  6%  5%  6%  4%  7%
[libx264 @ 0x7fcf3b80c400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 17% 17%  5%  8%  6%  7%  5%  7%
[libx264 @ 0x7fcf3b80c400] i8c dc,h,v,p: 60% 17% 20%  3%
[libx264 @ 0x7fcf3b80c400] Weighted P-Frames: Y:15.6% UV:3.1%
[libx264 @ 0x7fcf3b80c400] ref P L0: 65.5% 14.4% 14.7%  4.7%  0.6%
[libx264 @ 0x7fcf3b80c400] ref B L0: 90.5%  8.5%  1.0%
[libx264 @ 0x7fcf3b80c400] ref B L1: 96.6%  3.4%
[libx264 @ 0x7fcf3b80c400] kb/s:692.70
+ ffmpeg -i vfcopy.mp4
+ egrep 'Duration|Stream'

   Duration: 00:00:10.01, start: 0.000000, bitrate: 836 kb/s <<<<<< OUTPUT VIDEO BITRATE

     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x406, 693 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn, 47.95 tbc (default)
     Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 136 kb/s (default)


-- 
Love Living Well Doing What You Love?
http://DavidFavor.com/books can help!


More information about the ffmpeg-devel mailing list