[FFmpeg-user] Playback problems for video compressed as lossless H.264

Misha Penkov misha.penkov at gmail.com
Mon Jul 23 05:46:15 CEST 2012


Hi,

I'm compressing a video with ffmpeg and libx264.  I want lossless compression:

ffmpeg -i h.264/00.mp4 -vcodec libx264 -g 30 -qmax 0 -y bad.mp4 > bad.txt 2>&1

If I try to play back the file in any standard video player (e.g.
VLC), then the video does not play back smoothly, and many frames are
just gray.  Strangely, in ffplay, it seems to work just fine.

If I use lossy compression:

ffmpeg -i h.264/00.mp4 -vcodec libx264 -g 30 -y good.mp4 > good.txt 2>&1

then things work fine.

What could be the problem?  I can provide the test media if required.

My version of ffmpeg is N-42806-gf4451d2.

Cheers,
Misha
-------------- next part --------------
ffmpeg version N-42806-gf4451d2 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul 23 2012 12:00:06 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-libvpx --enable-shared --enable-pic --enable-libopencv
  libavutil      51. 65.100 / 51. 65.100
  libavcodec     54. 44.100 / 54. 44.100
  libavformat    54. 19.100 / 54. 19.100
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3.  3.100 /  3.  3.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'h.264/00.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.6.101
  Duration: 00:00:10.08, start: 0.000000, bitrate: 143388 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 143385 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler
[libx264 @ 0x2634e80] using SAR=1/1
[libx264 @ 0x2634e80] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x2634e80] profile High, level 3.1
[libx264 @ 0x2634e80] 264 - core 118 r2085 8a62835 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - 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=6 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=30 keyint_min=3 scenecut=40 intra_refresh=0 rc_lookahead=30 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=0 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'bad.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.19.100
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1-0, 25 tbn, 25 tbc
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
Press [q] to stop, [?] for help
DTS -1, next:-40000 st:0 invalid dropping
frame=   16 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
frame=   34 fps= 33 q=0.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
frame=   42 fps= 25 q=0.0 size=    1024kB time=00:00:00.00 bitrate=   0.0kbits/s    
frame=   45 fps= 20 q=0.0 size=    3275kB time=00:00:00.12 bitrate=223600.3kbits/s    
frame=   48 fps= 17 q=0.0 size=    5359kB time=00:00:00.24 bitrate=182913.2kbits/s    
frame=   54 fps= 15 q=0.0 size=    9581kB time=00:00:00.48 bitrate=163514.3kbits/s    
frame=   57 fps= 13 q=0.0 size=   11897kB time=00:00:00.60 bitrate=162439.3kbits/s    
frame=   63 fps= 12 q=0.0 size=   16490kB time=00:00:00.84 bitrate=160813.7kbits/s    
frame=   69 fps= 11 q=0.0 size=   20938kB time=00:00:01.08 bitrate=158816.3kbits/s    
frame=   75 fps= 11 q=0.0 size=   25402kB time=00:00:01.32 bitrate=157646.7kbits/s    
frame=   78 fps= 10 q=0.0 size=   27503kB time=00:00:01.44 bitrate=156464.1kbits/s    
frame=   82 fps=9.9 q=0.0 size=   30324kB time=00:00:01.60 bitrate=155258.1kbits/s    
frame=   87 fps=9.8 q=0.0 size=   33863kB time=00:00:01.80 bitrate=154115.0kbits/s    
frame=   89 fps=9.4 q=0.0 size=   35336kB time=00:00:01.88 bitrate=153974.9kbits/s    
frame=   94 fps=9.4 q=0.0 size=   38994kB time=00:00:02.08 bitrate=153576.9kbits/s    
frame=   97 fps=9.0 q=0.0 size=   41214kB time=00:00:02.20 bitrate=153467.8kbits/s    
frame=  103 fps=8.9 q=0.0 size=   45532kB time=00:00:02.44 bitrate=152867.9kbits/s    
frame=  109 fps=8.8 q=0.0 size=   49762kB time=00:00:02.68 bitrate=152109.0kbits/s    
frame=  113 fps=8.6 q=0.0 size=   52724kB time=00:00:02.84 bitrate=152084.1kbits/s    
frame=  117 fps=8.6 q=0.0 size=   55770kB time=00:00:03.00 bitrate=152288.8kbits/s    
frame=  120 fps=8.5 q=0.0 size=   58111kB time=00:00:03.12 bitrate=152579.2kbits/s    
frame=  122 fps=8.3 q=0.0 size=   59621kB time=00:00:03.20 bitrate=152629.0kbits/s    
frame=  127 fps=8.3 q=0.0 size=   63087kB time=00:00:03.40 bitrate=152001.6kbits/s    
frame=  130 fps=8.1 q=0.0 size=   65199kB time=00:00:03.52 bitrate=151737.0kbits/s    
frame=  135 fps=8.1 q=0.0 size=   69020kB time=00:00:03.72 bitrate=151991.5kbits/s    
frame=  141 fps=8.1 q=0.0 size=   73555kB time=00:00:03.96 bitrate=152162.6kbits/s    
frame=  144 fps=7.9 q=0.0 size=   75805kB time=00:00:04.08 bitrate=152204.4kbits/s    
frame=  149 fps=7.9 q=0.0 size=   79309kB time=00:00:04.28 bitrate=151799.7kbits/s    
frame=  155 fps=7.9 q=0.0 size=   83518kB time=00:00:04.52 bitrate=151367.9kbits/s    
frame=  158 fps=7.8 q=0.0 size=   85670kB time=00:00:04.64 bitrate=151251.2kbits/s    
frame=  163 fps=7.7 q=0.0 size=   89292kB time=00:00:04.84 bitrate=151132.0kbits/s    
frame=  169 fps=7.7 q=0.0 size=   93798kB time=00:00:05.08 bitrate=151258.2kbits/s    
frame=  174 fps=7.7 q=0.0 size=   97567kB time=00:00:05.28 bitrate=151376.9kbits/s    
frame=  177 fps=7.6 q=0.0 size=   99713kB time=00:00:05.40 bitrate=151268.4kbits/s    
frame=  181 fps=7.6 q=0.0 size=  102604kB time=00:00:05.56 bitrate=151174.1kbits/s    
frame=  184 fps=7.5 q=0.0 size=  104743kB time=00:00:05.68 bitrate=151066.1kbits/s    
frame=  190 fps=7.5 q=0.0 size=  108876kB time=00:00:05.92 bitrate=150660.6kbits/s    
frame=  194 fps=7.5 q=0.0 size=  111953kB time=00:00:06.08 bitrate=150842.1kbits/s    
frame=  198 fps=7.5 q=0.0 size=  114997kB time=00:00:06.24 bitrate=150970.4kbits/s    
frame=  203 fps=7.5 q=0.0 size=  118728kB time=00:00:06.44 bitrate=151028.3kbits/s    
frame=  208 fps=7.4 q=0.0 size=  122522kB time=00:00:06.64 bitrate=151160.2kbits/s    
frame=  214 fps=7.4 q=0.0 size=  126894kB time=00:00:06.88 bitrate=151092.2kbits/s    
frame=  218 fps=7.4 q=0.0 size=  129773kB time=00:00:07.04 bitrate=151008.4kbits/s    
frame=  222 fps=7.4 q=0.0 size=  132802kB time=00:00:07.20 bitrate=151099.5kbits/s    
frame=  228 fps=7.4 q=0.0 size=  136915kB time=00:00:07.44 bitrate=150753.5kbits/s    
frame=  234 fps=7.4 q=0.0 size=  141048kB time=00:00:07.68 bitrate=150451.3kbits/s    
frame=  240 fps=7.4 q=0.0 size=  145114kB time=00:00:07.92 bitrate=150097.7kbits/s    
frame=  243 fps=7.4 q=0.0 size=  147067kB time=00:00:08.04 bitrate=149847.0kbits/s    
frame=  252 fps=6.6 q=-1.0 Lsize=  176407kB time=00:00:10.00 bitrate=144512.9kbits/s    
video:176403kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.002658%
[libx264 @ 0x2634e80] frame I:11    Avg QP: 0.00  size:760577
[libx264 @ 0x2634e80] frame P:118   Avg QP: 0.00  size:757793
[libx264 @ 0x2634e80] frame B:123   Avg QP: 0.00  size:673575
[libx264 @ 0x2634e80] consecutive B-frames:  7.1% 78.6% 14.3%  0.0%
[libx264 @ 0x2634e80] mb I  I16..4: 16.8% 24.7% 58.4%
[libx264 @ 0x2634e80] mb P  I16..4:  0.3%  1.4% 18.1%  P16..4: 30.7% 29.3% 20.2%  0.0%  0.0%    skip: 0.0%
[libx264 @ 0x2634e80] mb B  I16..4:  0.0%  0.0%  0.2%  B16..8: 46.0% 10.7% 10.7%  direct:32.0%  skip: 0.3%  L0:17.0% L1:15.4% BI:67.6%
[libx264 @ 0x2634e80] 8x8 transform intra:12.8% inter:46.6%
[libx264 @ 0x2634e80] coded y,uvDC,uvAC intra: 98.5% 99.9% 99.8% inter: 98.9% 99.4% 99.4%
[libx264 @ 0x2634e80] i16 v,h,dc,p: 19% 18% 42% 21%
[libx264 @ 0x2634e80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 14% 40%  3%  4%  5%  6%  5%  7%
[libx264 @ 0x2634e80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 19% 10%  6%  9%  8% 13%  9% 14%
[libx264 @ 0x2634e80] i8c dc,h,v,p: 68% 12%  9% 11%
[libx264 @ 0x2634e80] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x2634e80] ref P L0: 60.9% 19.8% 12.0%  7.3%
[libx264 @ 0x2634e80] ref B L0: 89.3%  9.7%  1.0%
[libx264 @ 0x2634e80] ref B L1: 98.5%  1.5%
[libx264 @ 0x2634e80] kb/s:143361.61
-------------- next part --------------
ffmpeg version N-42806-gf4451d2 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul 23 2012 12:00:06 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-libvpx --enable-shared --enable-pic --enable-libopencv
  libavutil      51. 65.100 / 51. 65.100
  libavcodec     54. 44.100 / 54. 44.100
  libavformat    54. 19.100 / 54. 19.100
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3.  3.100 /  3.  3.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'h.264/00.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.6.101
  Duration: 00:00:10.08, start: 0.000000, bitrate: 143388 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 143385 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler
[libx264 @ 0xbc9e80] using SAR=1/1
[libx264 @ 0xbc9e80] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0xbc9e80] profile High, level 3.1
[libx264 @ 0xbc9e80] 264 - core 118 r2085 8a62835 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - 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=6 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=30 keyint_min=3 scenecut=40 intra_refresh=0 rc_lookahead=30 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 'good.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.19.100
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 tbn, 25 tbc
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
Press [q] to stop, [?] for help
DTS -1, next:-40000 st:0 invalid dropping
frame=   17 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
frame=   37 fps= 28 q=0.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
frame=   46 fps= 25 q=28.0 size=     314kB time=00:00:00.16 bitrate=16055.6kbits/s    
frame=   54 fps= 22 q=28.0 size=     606kB time=00:00:00.48 bitrate=10344.6kbits/s    
frame=   61 fps= 21 q=28.0 size=     961kB time=00:00:00.76 bitrate=10360.5kbits/s    
frame=   67 fps= 19 q=28.0 size=    1237kB time=00:00:01.00 bitrate=10132.6kbits/s    
frame=   75 fps= 19 q=28.0 size=    1663kB time=00:00:01.32 bitrate=10323.7kbits/s    
frame=   82 fps= 18 q=28.0 size=    1922kB time=00:00:01.60 bitrate=9839.4kbits/s    
frame=   87 fps= 17 q=28.0 size=    2090kB time=00:00:01.80 bitrate=9513.6kbits/s    
frame=   94 fps= 17 q=28.0 size=    2408kB time=00:00:02.08 bitrate=9482.1kbits/s    
frame=  102 fps= 17 q=28.0 size=    2871kB time=00:00:02.40 bitrate=9800.0kbits/s    
frame=  109 fps= 17 q=28.0 size=    3099kB time=00:00:02.68 bitrate=9473.9kbits/s    
frame=  117 fps= 16 q=28.0 size=    3450kB time=00:00:03.00 bitrate=9420.9kbits/s    
frame=  125 fps= 16 q=28.0 size=    3807kB time=00:00:03.32 bitrate=9393.4kbits/s    
frame=  134 fps= 16 q=28.0 size=    4299kB time=00:00:03.68 bitrate=9569.9kbits/s    
frame=  141 fps= 16 q=28.0 size=    4587kB time=00:00:03.96 bitrate=9490.0kbits/s    
frame=  150 fps= 16 q=28.0 size=    4966kB time=00:00:04.32 bitrate=9416.7kbits/s    
frame=  155 fps= 15 q=28.0 size=    5125kB time=00:00:04.52 bitrate=9288.8kbits/s    
frame=  164 fps= 16 q=28.0 size=    5602kB time=00:00:04.88 bitrate=9404.5kbits/s    
frame=  171 fps= 15 q=28.0 size=    5878kB time=00:00:05.16 bitrate=9332.0kbits/s    
frame=  179 fps= 15 q=28.0 size=    6199kB time=00:00:05.48 bitrate=9267.0kbits/s    
frame=  187 fps= 15 q=28.0 size=    6483kB time=00:00:05.80 bitrate=9156.9kbits/s    
frame=  195 fps= 15 q=28.0 size=    6910kB time=00:00:06.12 bitrate=9249.1kbits/s    
frame=  203 fps= 15 q=28.0 size=    7290kB time=00:00:06.44 bitrate=9273.1kbits/s    
frame=  213 fps= 15 q=28.0 size=    7744kB time=00:00:06.84 bitrate=9274.5kbits/s    
frame=  221 fps= 15 q=28.0 size=    8204kB time=00:00:07.16 bitrate=9386.4kbits/s    
frame=  229 fps= 15 q=28.0 size=    8406kB time=00:00:07.48 bitrate=9205.8kbits/s    
frame=  240 fps= 15 q=28.0 size=    8725kB time=00:00:07.92 bitrate=9024.6kbits/s    
frame=  252 fps= 15 q=-1.0 Lsize=    9833kB time=00:00:10.00 bitrate=8054.9kbits/s    
video:9829kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.038719%
[libx264 @ 0xbc9e80] frame I:11    Avg QP:22.28  size:174168
[libx264 @ 0xbc9e80] frame P:118   Avg QP:26.07  size: 58803
[libx264 @ 0xbc9e80] frame B:123   Avg QP:30.08  size:  9834
[libx264 @ 0xbc9e80] consecutive B-frames:  7.1% 78.6% 14.3%  0.0%
[libx264 @ 0xbc9e80] mb I  I16..4:  6.0% 69.8% 24.2%
[libx264 @ 0xbc9e80] mb P  I16..4:  0.0%  1.9%  1.0%  P16..4: 41.2% 26.4% 18.4%  0.0%  0.0%    skip:11.0%
[libx264 @ 0xbc9e80] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 33.1%  2.9%  1.1%  direct: 7.5%  skip:55.4%  L0:28.1% L1:54.0% BI:17.9%
[libx264 @ 0xbc9e80] 8x8 transform intra:68.5% inter:53.3%
[libx264 @ 0xbc9e80] coded y,uvDC,uvAC intra: 88.3% 84.7% 65.6% inter: 38.9% 13.2% 1.4%
[libx264 @ 0xbc9e80] i16 v,h,dc,p: 74% 14% 11%  1%
[libx264 @ 0xbc9e80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 20% 16%  4%  7%  7% 10%  7% 11%
[libx264 @ 0xbc9e80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 19% 10%  6%  9%  9% 13%  8% 13%
[libx264 @ 0xbc9e80] i8c dc,h,v,p: 55% 22% 17%  6%
[libx264 @ 0xbc9e80] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0xbc9e80] ref P L0: 68.1% 19.3%  8.2%  4.3%
[libx264 @ 0xbc9e80] ref B L0: 89.0% 10.8%  0.2%
[libx264 @ 0xbc9e80] ref B L1: 98.9%  1.1%
[libx264 @ 0xbc9e80] kb/s:7987.36


More information about the ffmpeg-user mailing list