[FFmpeg-trac] #3307(undetermined:new): -level AVoption does not set refs with libx264

FFmpeg trac at avcodec.org
Wed Jan 15 07:41:29 CET 2014


#3307: -level AVoption does not set refs with libx264
-------------------------------------+-------------------------------------
               Reporter:  llogan     |                  Owner:
                   Type:  defect     |                 Status:  new
               Priority:  normal     |              Component:
                Version:  git-       |  undetermined
  master                             |               Keywords:  libx264
             Blocked By:             |               Blocking:
Reproduced by developer:  0          |  Analyzed by developer:  0
-------------------------------------+-------------------------------------
 I expect the -level libx264 AVoption to have the same behavior as --level
 in x264. One thing it should do is choose an appropriate number of
 reference frames for the specified level.

 -level 3.0
 {{{
 $ ./ffmpeg -i fate-suite/h264/lossless.h264 -preset veryslow -level 3.0
 fflevel.h264
 ffmpeg version N-59860-g53e6977 Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Jan 14 2014 20:17:56 with gcc 4.8.2 (GCC) 20131219 (prerelease)
   configuration: --enable-gpl --enable-libx264
   libavutil      52. 62.100 / 52. 62.100
   libavcodec     55. 48.101 / 55. 48.101
   libavformat    55. 23.103 / 55. 23.103
   libavdevice    55.  5.102 / 55.  5.102
   libavfilter     4.  1.100 /  4.  1.100
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
   libpostproc    52.  3.100 / 52.  3.100
 Input #0, h264, from 'fate-suite/h264/lossless.h264':
   Duration: N/A, bitrate: N/A
     Stream #0:0: Video: h264 (High 4:4:4 Predictive), yuv420p, 640x480, 60
 fps, 60 tbr, 1200k tbn, 120 tbc
 [libx264 @ 0x36a5760] DPB size (16 frames, 19200 mbs) > level limit (6
 frames, 8100 mbs)
 [libx264 @ 0x36a5760] MB rate (72000) > level limit (40500)
 [libx264 @ 0x36a5760] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
 [libx264 @ 0x36a5760] profile High, level 3.0
 Output #0, h264, to 'fflevel.h264':
   Metadata:
     encoder         : Lavf55.23.103
     Stream #0:0: Video: h264 (libx264), yuv420p, 640x480, q=-1--1, 90k
 tbn, 60 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 -> libx264)
 Press [q] to stop, [?] for help
 frame=   10 fps=0.0 q=-1.0 Lsize=      51kB time=00:00:00.13
 bitrate=3130.6kbits/s
 video:51kB audio:0kB subtitle:0 global headers:0kB muxing overhead
 0.000000%
 [libx264 @ 0x36a5760] frame I:1     Avg QP:28.41  size: 37028
 [libx264 @ 0x36a5760] frame P:2     Avg QP:32.95  size:  3322
 [libx264 @ 0x36a5760] frame B:7     Avg QP:35.58  size:  1215
 [libx264 @ 0x36a5760] consecutive B-frames: 10.0%  0.0%  0.0% 40.0% 50.0%
 0.0%  0.0%  0.0%  0.0%
 [libx264 @ 0x36a5760] mb I  I16..4:  7.0% 46.5% 46.5%
 [libx264 @ 0x36a5760] mb P  I16..4:  0.2%  1.6%  0.5%  P16..4: 28.3%  9.2%
 6.8%  0.6%  0.1%    skip:52.8%
 [libx264 @ 0x36a5760] mb B  I16..4:  0.0%  0.2%  0.0%  B16..8: 29.0%  6.0%
 1.4%  direct: 1.5%  skip:61.9%  L0:51.5% L1:44.8% BI: 3.7%
 [libx264 @ 0x36a5760] 8x8 transform intra:48.1% inter:53.1%
 [libx264 @ 0x36a5760] direct mvs  spatial:28.6% temporal:71.4%
 [libx264 @ 0x36a5760] coded y,uvDC,uvAC intra: 84.0% 56.6% 37.9% inter:
 5.0% 1.0% 0.2%
 [libx264 @ 0x36a5760] i16 v,h,dc,p: 36% 37% 12% 16%
 [libx264 @ 0x36a5760] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 12%  6% 10% 12%
 11% 14% 10% 15%
 [libx264 @ 0x36a5760] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20%  9%  4% 10% 11%
 12% 10% 11% 13%
 [libx264 @ 0x36a5760] i8c dc,h,v,p: 37% 29% 21% 13%
 [libx264 @ 0x36a5760] Weighted P-Frames: Y:0.0% UV:0.0%
 [libx264 @ 0x36a5760] ref P L0: 69.1% 23.9%  4.6%  2.5%
 [libx264 @ 0x36a5760] ref B L0: 86.7% 10.6%  2.5%  0.2%
 [libx264 @ 0x36a5760] ref B L1: 89.7% 10.3%
 [libx264 @ 0x36a5760] kb/s:2504.51
 }}}

 ref=16
 {{{
 $ strings fflevel.h264 | grep x264
 x264 - core 140 r2377 1ca7bb9 - H.264/MPEG-4 AVC codec - Copyleft
 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=16
 deblock=1:0:0 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.00
 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 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=8 b_pyramid=2 b_adapt=2
 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=23.0
 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
 }}}

 without -level 3.0
 {{{
 $ ./ffmpeg -i fate-suite/h264/lossless.h264 -preset veryslow
 ffnolevel.h264
 ffmpeg version N-59860-g53e6977 Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Jan 14 2014 20:17:56 with gcc 4.8.2 (GCC) 20131219 (prerelease)
   configuration: --enable-gpl --enable-libx264
   libavutil      52. 62.100 / 52. 62.100
   libavcodec     55. 48.101 / 55. 48.101
   libavformat    55. 23.103 / 55. 23.103
   libavdevice    55.  5.102 / 55.  5.102
   libavfilter     4.  1.100 /  4.  1.100
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
   libpostproc    52.  3.100 / 52.  3.100
 Input #0, h264, from 'fate-suite/h264/lossless.h264':
   Duration: N/A, bitrate: N/A
     Stream #0:0: Video: h264 (High 4:4:4 Predictive), yuv420p, 640x480, 60
 fps, 60 tbr, 1200k tbn, 120 tbc
 [libx264 @ 0x262a740] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
 [libx264 @ 0x262a740] profile High, level 3.2
 Output #0, h264, to 'ffnolevel.h264':
   Metadata:
     encoder         : Lavf55.23.103
     Stream #0:0: Video: h264 (libx264), yuv420p, 640x480, q=-1--1, 90k
 tbn, 60 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 -> libx264)
 Press [q] to stop, [?] for help
 frame=   10 fps=0.0 q=-1.0 Lsize=      51kB time=00:00:00.13
 bitrate=3130.6kbits/s
 video:51kB audio:0kB subtitle:0 global headers:0kB muxing overhead
 0.000000%
 [libx264 @ 0x262a740] frame I:1     Avg QP:28.41  size: 37028
 [libx264 @ 0x262a740] frame P:2     Avg QP:32.95  size:  3322
 [libx264 @ 0x262a740] frame B:7     Avg QP:35.58  size:  1215
 [libx264 @ 0x262a740] consecutive B-frames: 10.0%  0.0%  0.0% 40.0% 50.0%
 0.0%  0.0%  0.0%  0.0%
 [libx264 @ 0x262a740] mb I  I16..4:  7.0% 46.5% 46.5%
 [libx264 @ 0x262a740] mb P  I16..4:  0.2%  1.6%  0.5%  P16..4: 28.3%  9.2%
 6.8%  0.6%  0.1%    skip:52.8%
 [libx264 @ 0x262a740] mb B  I16..4:  0.0%  0.2%  0.0%  B16..8: 29.0%  6.0%
 1.4%  direct: 1.5%  skip:61.9%  L0:51.5% L1:44.8% BI: 3.7%
 [libx264 @ 0x262a740] 8x8 transform intra:48.1% inter:53.1%
 [libx264 @ 0x262a740] direct mvs  spatial:28.6% temporal:71.4%
 [libx264 @ 0x262a740] coded y,uvDC,uvAC intra: 84.0% 56.6% 37.9% inter:
 5.0% 1.0% 0.2%
 [libx264 @ 0x262a740] i16 v,h,dc,p: 36% 37% 12% 16%
 [libx264 @ 0x262a740] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 12%  6% 10% 12%
 11% 14% 10% 15%
 [libx264 @ 0x262a740] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20%  9%  4% 10% 11%
 12% 10% 11% 13%
 [libx264 @ 0x262a740] i8c dc,h,v,p: 37% 29% 21% 13%
 [libx264 @ 0x262a740] Weighted P-Frames: Y:0.0% UV:0.0%
 [libx264 @ 0x262a740] ref P L0: 69.1% 23.9%  4.6%  2.5%
 [libx264 @ 0x262a740] ref B L0: 86.7% 10.6%  2.5%  0.2%
 [libx264 @ 0x262a740] ref B L1: 89.7% 10.3%
 [libx264 @ 0x262a740] kb/s:2504.51
 }}}

 ref=16
 {{{
 $ strings ffnolevel.h264 | grep x264
 x264 - core 140 r2377 1ca7bb9 - H.264/MPEG-4 AVC codec - Copyleft
 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=16
 deblock=1:0:0 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.00
 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 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=8 b_pyramid=2 b_adapt=2
 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=23.0
 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
 }}}

 ----

 --level 3.0
 {{{
 $ x264 --preset veryslow --level 3.0 -o x264level.h264 fate-
 suite/h264/lossless.h264
 lavf [info]: 640x480p 0:1 @ 60/1 fps (cfr)
 x264 [warning]: MB rate (72000) > level limit (40500)
 x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
 x264 [info]: profile High, level 3.0
 x264 [info]: frame I:1     Avg QP:28.41  size: 37026
 x264 [info]: frame P:2     Avg QP:32.95  size:  3322
 x264 [info]: frame B:7     Avg QP:35.58  size:  1215
 x264 [info]: consecutive B-frames: 10.0%  0.0%  0.0% 40.0% 50.0%  0.0%
 0.0%  0.0%  0.0%
 x264 [info]: mb I  I16..4:  7.0% 46.5% 46.5%
 x264 [info]: mb P  I16..4:  0.2%  1.6%  0.5%  P16..4: 28.3%  9.2%  6.8%
 0.6%  0.1%    skip:52.8%
 x264 [info]: mb B  I16..4:  0.0%  0.2%  0.0%  B16..8: 29.0%  6.0%  1.4%
 direct: 1.5%  skip:61.9%  L0:51.5% L1:44.8% BI: 3.7%
 x264 [info]: 8x8 transform intra:48.1% inter:53.1%
 x264 [info]: direct mvs  spatial:28.6% temporal:71.4%
 x264 [info]: coded y,uvDC,uvAC intra: 84.0% 56.6% 37.9% inter: 5.0% 1.0%
 0.2%
 x264 [info]: i16 v,h,dc,p: 36% 37% 12% 16%
 x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 12%  6% 10% 12% 11% 14%
 10% 15%
 x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20%  9%  4% 10% 11% 12% 10%
 11% 13%
 x264 [info]: i8c dc,h,v,p: 37% 29% 21% 13%
 x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
 x264 [info]: ref P L0: 69.1% 23.9%  4.6%  2.5%
 x264 [info]: ref B L0: 86.7% 10.6%  2.5%  0.2%
 x264 [info]: ref B L1: 89.7% 10.3%
 x264 [info]: kb/s:2504.26

 encoded 10 frames, 38.61 fps, 2504.26 kb/s
 }}}

 ref=6
 {{{
 $ strings x264level.h264 | grep x264
 x264 - core 140 r2377 1ca7bb9 - H.264/MPEG-4 AVC codec - Copyleft
 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=6
 deblock=1:0:0 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.00
 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 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=8 b_pyramid=2 b_adapt=2
 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=23.0
 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
 }}}

 without --level 3.0
 {{{
 $ x264 --preset veryslow -o x264nolevel.h264 fate-suite/h264/lossless.h264
 lavf [info]: 640x480p 0:1 @ 60/1 fps (cfr)
 x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
 x264 [info]: profile High, level 3.2
 x264 [info]: frame I:1     Avg QP:28.41  size: 37030
 x264 [info]: frame P:2     Avg QP:32.95  size:  3322
 x264 [info]: frame B:7     Avg QP:35.58  size:  1215
 x264 [info]: consecutive B-frames: 10.0%  0.0%  0.0% 40.0% 50.0%  0.0%
 0.0%  0.0%  0.0%
 x264 [info]: mb I  I16..4:  7.0% 46.5% 46.5%
 x264 [info]: mb P  I16..4:  0.2%  1.6%  0.5%  P16..4: 28.3%  9.2%  6.8%
 0.6%  0.1%    skip:52.8%
 x264 [info]: mb B  I16..4:  0.0%  0.2%  0.0%  B16..8: 29.0%  6.0%  1.4%
 direct: 1.5%  skip:61.9%  L0:51.5% L1:44.8% BI: 3.7%
 x264 [info]: 8x8 transform intra:48.1% inter:53.1%
 x264 [info]: direct mvs  spatial:28.6% temporal:71.4%
 x264 [info]: coded y,uvDC,uvAC intra: 84.0% 56.6% 37.9% inter: 5.0% 1.0%
 0.2%
 x264 [info]: i16 v,h,dc,p: 36% 37% 12% 16%
 x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 12%  6% 10% 12% 11% 14%
 10% 15%
 x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20%  9%  4% 10% 11% 12% 10%
 11% 13%
 x264 [info]: i8c dc,h,v,p: 37% 29% 21% 13%
 x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
 x264 [info]: ref P L0: 69.1% 23.9%  4.6%  2.5%
 x264 [info]: ref B L0: 86.7% 10.6%  2.5%  0.2%
 x264 [info]: ref B L1: 89.7% 10.3%
 x264 [info]: kb/s:2504.59
 }}}

 ref=16
 {{{
 $ strings x264nolevel.h264 | grep x264
 x264 - core 140 r2377 1ca7bb9 - H.264/MPEG-4 AVC codec - Copyleft
 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=16
 deblock=1:0:0 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.00
 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 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=8 b_pyramid=2 b_adapt=2
 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=23.0
 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3307>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list