Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#5232 closed defect (duplicate)

ffmpeg users wrong reference frames if -level is specified without a dot

Reported by: myleal Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: libx264
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When encoding to x264, the user can supply the x264 level information
in two ways:

-level 41 (Without dot)
-level 4.1 (Using a dot between the numbers)

In both cases, the encoded video shows the level as 4.1, but only in the second case the reference frames are correctly computed.

How to reproduce:

C:\Users\marcu\Downloads\ffmpeg-20160212-git-6973846-win64-static\ffmpeg-20160212-git-6973846-win64-static\bin>ffmpeg -i http://ftp.nluug.nl/pub/graphics/blender/demo/movies/ToS/ToS-4k-1920.mov -t 5 -level 4.1 -an -preset veryslow output1.mkv
ffmpeg version N-78395-g6973846 Copyright (c) 2000-2016 the FFmpeg developers

built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 17.100 / 55. 17.100
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'http://ftp.nluug.nl/pub/graphics/blender/demo/movies/ToS/ToS-4k-1920.mov':

Metadata:

major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf54.29.104

Duration: 00:12:14.17, start: 0.000000, bitrate: 8051 kb/s

Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x800 [SAR 1:1 DAR 12:5], 7862 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc (default)
Metadata:

handler_name : DataHandler?
encoder : libx264

Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 182 kb/s (default)
Metadata:

handler_name : DataHandler?

[libx264 @ 0000016ac7b94820] using SAR=1/1
[libx264 @ 0000016ac7b94820] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA4 FMA3 LZCNT BMI1
[libx264 @ 0000016ac7b94820] profile High, level 4.1
[libx264 @ 0000016ac7b94820] 264 - core 148 r2665 a01e339 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 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=6 lookahead_threads=1 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=24 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
Output #0, matroska, to 'output1.mkv':

Metadata:

major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf57.25.100
Stream #0:0(eng): Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 1920x800 [SAR 1:1 DAR 12:5], q=-1--1, 24 fps, 1k tbn, 24 tbc (default)
Metadata:

handler_name : DataHandler?
encoder : Lavc57.24.102 libx264

Side data:

unknown side data type 10 (24 bytes)

Stream mapping:

Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))

Press [q] to stop, ? for help
frame= 120 fps= 39 q=-1.0 Lsize= 13kB time=00:00:04.91 bitrate= 22.3kbits/s speed=1.59x
video:12kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 13.556367%
[libx264 @ 0000016ac7b94820] frame I:2 Avg QP: 3.92 size: 2126
[libx264 @ 0000016ac7b94820] frame P:15 Avg QP: 9.76 size: 87
[libx264 @ 0000016ac7b94820] frame B:103 Avg QP:13.00 size: 56
[libx264 @ 0000016ac7b94820] consecutive B-frames: 2.5% 0.0% 0.0% 3.3% 4.2% 0.0% 0.0% 0.0% 90.0%
[libx264 @ 0000016ac7b94820] mb I I16..4: 99.2% 0.0% 0.8%
[libx264 @ 0000016ac7b94820] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.0% 0.0% 0.0% 0.0% 0.0% skip:100.0%
[libx264 @ 0000016ac7b94820] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.1% 0.0% 0.0% direct: 0.0% skip:99.9% L0:50.8% L1:49.2% BI: 0.0%
[libx264 @ 0000016ac7b94820] 8x8 transform intra:0.1% inter:0.0%
[libx264 @ 0000016ac7b94820] direct mvs spatial:86.4% temporal:13.6%
[libx264 @ 0000016ac7b94820] coded y,uvDC,uvAC intra: 0.6% 0.0% 0.0% inter: 0.0% 0.0% 0.0%
[libx264 @ 0000016ac7b94820] i16 v,h,dc,p: 98% 0% 2% 0%
[libx264 @ 0000016ac7b94820] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 6% 53% 3% 0% 0% 0% 0% 8%
[libx264 @ 0000016ac7b94820] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 46% 24% 18% 2% 3% 2% 2% 1% 2%
[libx264 @ 0000016ac7b94820] i8c dc,h,v,p: 100% 0% 0% 0%
[libx264 @ 0000016ac7b94820] Weighted P-Frames: Y:13.3% UV:0.0%
[libx264 @ 0000016ac7b94820] ref P L0: 95.2% 0.0% 4.8%
[libx264 @ 0000016ac7b94820] ref B L1: 93.8% 6.2%
[libx264 @ 0000016ac7b94820] kb/s:18.17

C:\Users\marcu\Downloads\ffmpeg-20160212-git-6973846-win64-static\ffmpeg-20160212-git-6973846-win64-static\bin>ffmpeg -i http://ftp.nluug.nl/pub/graphics/blender/demo/movies/ToS/ToS-4k-1920.mov -t 5 -level 41 -an -preset veryslow output2.mkv
ffmpeg version N-78395-g6973846 Copyright (c) 2000-2016 the FFmpeg developers

built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 17.100 / 55. 17.100
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'http://ftp.nluug.nl/pub/graphics/blender/demo/movies/ToS/ToS-4k-1920.mov':

Metadata:

major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf54.29.104

Duration: 00:12:14.17, start: 0.000000, bitrate: 8051 kb/s

Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x800 [SAR 1:1 DAR 12:5], 7862 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc (default)
Metadata:

handler_name : DataHandler?
encoder : libx264

Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 182 kb/s (default)
Metadata:

handler_name : DataHandler?

[libx264 @ 0000018de9984820] using SAR=1/1
[libx264 @ 0000018de9984820] DPB size (16 frames, 96000 mbs) > level limit (5 frames, 32768 mbs)
[libx264 @ 0000018de9984820] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA4 FMA3 LZCNT BMI1
[libx264 @ 0000018de9984820] profile High, level 4.1
[libx264 @ 0000018de9984820] 264 - core 148 r2665 a01e339 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - 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=6 lookahead_threads=1 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=24 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
Output #0, matroska, to 'output2.mkv':

Metadata:

major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf57.25.100
Stream #0:0(eng): Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 1920x800 [SAR 1:1 DAR 12:5], q=-1--1, 24 fps, 1k tbn, 24 tbc (default)
Metadata:

handler_name : DataHandler?
encoder : Lavc57.24.102 libx264

Side data:

unknown side data type 10 (24 bytes)

Stream mapping:

Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))

Press [q] to stop, ? for help
frame= 120 fps= 39 q=-1.0 Lsize= 13kB time=00:00:04.91 bitrate= 22.4kbits/s speed=1.62x
video:12kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 13.451881%
[libx264 @ 0000018de9984820] frame I:2 Avg QP: 3.92 size: 2126
[libx264 @ 0000018de9984820] frame P:15 Avg QP: 9.76 size: 92
[libx264 @ 0000018de9984820] frame B:103 Avg QP:13.00 size: 57
[libx264 @ 0000018de9984820] consecutive B-frames: 2.5% 0.0% 0.0% 3.3% 4.2% 0.0% 0.0% 0.0% 90.0%
[libx264 @ 0000018de9984820] mb I I16..4: 99.2% 0.0% 0.8%
[libx264 @ 0000018de9984820] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.0% 0.0% 0.0% 0.0% 0.0% skip:100.0%
[libx264 @ 0000018de9984820] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.1% 0.0% 0.0% direct: 0.0% skip:99.9% L0:50.8% L1:49.2% BI: 0.0%
[libx264 @ 0000018de9984820] 8x8 transform intra:0.1% inter:0.0%
[libx264 @ 0000018de9984820] direct mvs spatial:86.4% temporal:13.6%
[libx264 @ 0000018de9984820] coded y,uvDC,uvAC intra: 0.6% 0.0% 0.0% inter: 0.0% 0.0% 0.0%
[libx264 @ 0000018de9984820] i16 v,h,dc,p: 98% 0% 2% 0%
[libx264 @ 0000018de9984820] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 6% 53% 3% 0% 0% 0% 0% 8%
[libx264 @ 0000018de9984820] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 46% 24% 18% 2% 3% 2% 2% 1% 2%
[libx264 @ 0000018de9984820] i8c dc,h,v,p: 100% 0% 0% 0%
[libx264 @ 0000018de9984820] Weighted P-Frames: Y:13.3% UV:0.0%
[libx264 @ 0000018de9984820] ref P L0: 95.2% 0.0% 4.8%
[libx264 @ 0000018de9984820] ref B L1: 93.8% 6.2%
[libx264 @ 0000018de9984820] kb/s:18.33


Geral
UniqueID/String : 290458334713559383178452379481031674741 (0xDA843D8D9E36648C8BAD4CD86A798B75)
Nome completo : C:\Users\marcu\Downloads\ffmpeg-20160212-git-6973846-win64-static\ffmpeg-20160212-git-6973846-win64-static\bin\output1.mkv
Formato : Matroska
Versão do Formato : Version 4 / Version 2
Tamanho do arquivo : 13.4 KiB
Duração : 5s 0ms
Taxa de Bits Total : 21.9 Kbps
Programa usado : Lavf57.25.100
Biblioteca usada : Lavf57.25.100

Vídeo
ID : 1
Formato : AVC
Formato/Informações? : Advanced Video Codec
Perfil do Formato : High@L4.1
Conf do Formato, CABAC : Sim
Conf do Formato, Quadros de Ref. : 5 quadros
ID do Codec : V_MPEG4/ISO/AVC


Geral
UniqueID/String : 264507464774497976163894216703360023568 (0xC6FE48E19879A04B211DDB7BF3AABC10)
Nome completo : C:\Users\marcu\Downloads\ffmpeg-20160212-git-6973846-win64-static\ffmpeg-20160212-git-6973846-win64-static\bin\output2.mkv
Formato : Matroska
Versão do Formato : Version 4 / Version 2
Tamanho do arquivo : 13.5 KiB
Duração : 5s 0ms
Taxa de Bits Total : 22.0 Kbps
Programa usado : Lavf57.25.100
Biblioteca usada : Lavf57.25.100

Vídeo
ID : 1
Formato : AVC
Formato/Informações? : Advanced Video Codec
Perfil do Formato : High@L4.1
Conf do Formato, CABAC : Sim
Conf do Formato, Quadros de Ref. : 16 quadros
ID do Codec : V_MPEG4/ISO/AVC

Change History (2)

comment:1 Changed 3 years ago by cehoyos

  • Component changed from undetermined to avcodec
  • Keywords libx264 added
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version changed from unspecified to git-master

See #3307

comment:2 Changed 3 years ago by myleal

Thank you for the feedback. I did not realized that the #3307 was reopened with the 'dot' issue.

Note: See TracTickets for help on using tickets.