[FFmpeg-trac] #5493(avfilter:open): incomplete x264 MB tree with framerate filter
FFmpeg
trac at avcodec.org
Wed Jun 15 16:03:22 CEST 2016
#5493: incomplete x264 MB tree with framerate filter
-------------------------------------+-------------------------------------
Reporter: blacktrash | Owner:
Type: defect | Status: open
Priority: important | Component: avfilter
Version: git-master | Resolution:
Keywords: framerate | Blocked By:
libx264 regression | Reproduced by developer: 1
Blocking: |
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by blacktrash):
Replying to [comment:7 michael]:
> Here:
> {{{
> x264 0.146.2538 121396c
> (libswscale 3.1.101)
> (libavformat 56.30.100)
> built on May 27 2015, gcc: 4.6.3
> x264 configuration: --bit-depth=8 --chroma-format=all
> libx264 configuration: --bit-depth=8 --chroma-format=all
> x264 license: GPL version 2 or later
> libswscale/libavformat license: GPL version 2 or later
> }}}
The issue is also present with x264 stable:
{{{
$ ffmpeg -i issue5493.mp4 -filter:v framerate=30,scale=640:360,fps=30 -b:v
500k -pass 1 -y test.mp4
ffmpeg version N-80335-gcb46b78 Copyright (c) 2000-2016 the FFmpeg
developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --enable-gpl --enable-nonfree --disable-ffserver
--enable-openssl --enable-libspeex --enable-libopus --enable-libfdk-aac
--enable-libx265 --enable-libx264 --enable-libxvid --enable-libfaac
--enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx
--enable-libvidstab --extra-cflags=-I/sw/include --extra-libs=-L/sw/lib
libavutil 55. 24.100 / 55. 24.100
libavcodec 57. 46.100 / 57. 46.100
libavformat 57. 38.100 / 57. 38.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 46.101 / 6. 46.101
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'issue5493.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2016-04-24 09:48:33
location : +60.4916+022.2685/
location-eng : +60.4916+022.2685/
com.android.version: 6.0.1
Duration: 00:00:52.12, start: 0.000000, bitrate: 15880 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1920x1080, 15715 kb/s, SAR 1:1 DAR 16:9, 25.48 fps, 90k tbr, 90k tbn, 180k
tbc (default)
Metadata:
creation_time : 2016-04-24 09:48:33
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 196 kb/s (default)
Metadata:
creation_time : 2016-04-24 09:48:33
handler_name : SoundHandle
[Parsed_framerate_0 @ 0x7fd821408280] time base:1/90000 -> 1/90000 exact:1
[Parsed_framerate_0 @ 0x7fd821408280] fps -> fps:30/1 scene score:7.000000
interpolate start:15 end:240
[libx264 @ 0x7fd821822600] using SAR=1/1
[libx264 @ 0x7fd821822600] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX
[libx264 @ 0x7fd821822600] profile Main, level 3.0
[libx264 @ 0x7fd821822600] 264 - core 148 r2699 a5e06b9 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options:
cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0 me=dia subme=2 psy=1
psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=11
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=25
scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=500
ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[mp4 @ 0x7fd821821400] Using AVStream.codec to pass codec parameters to
muxers is deprecated, use AVStream.codecpar instead.
Last message repeated 1 times
Output #0, mp4, to 'test.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
com.android.version: 6.0.1
location : +60.4916+022.2685/
location-eng : +60.4916+022.2685/
encoder : Lavf57.38.100
Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021),
yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 500 kb/s, 30 fps, 15360 tbn,
30 tbc (default)
Metadata:
creation_time : 2016-04-24 09:48:33
handler_name : VideoHandle
encoder : Lavc57.46.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/500000 buffer size: 0 vbv_delay: -1
Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz,
stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2016-04-24 09:48:33
handler_name : SoundHandle
encoder : Lavc57.46.100 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 58 fps=0.0 q=36.0 size= 9kB time=00:00:03.01 bitrate=
24.0kbits/s speed=6.02x
frame= 133 fps=132 q=30.0 size= 176kB time=00:00:05.01 bitrate=
287.2kbits/s speed=4.98x
frame= 207 fps=137 q=30.0 size= 361kB time=00:00:07.02 bitrate=
421.1kbits/s speed=4.65x
frame= 272 fps=135 q=28.0 size= 505kB time=00:00:10.03 bitrate=
412.6kbits/s speed=4.97x
frame= 346 fps=137 q=28.0 size= 701kB time=00:00:12.03 bitrate=
476.9kbits/s speed=4.78x
frame= 417 fps=138 q=31.0 size= 957kB time=00:00:14.04 bitrate=
558.0kbits/s speed=4.64x
frame= 484 fps=137 q=30.0 size= 1105kB time=00:00:17.05 bitrate=
530.8kbits/s speed=4.84x
frame= 558 fps=139 q=30.0 size= 1280kB time=00:00:19.05 bitrate=
550.2kbits/s speed=4.73x
frame= 630 fps=139 q=31.0 size= 1504kB time=00:00:21.06 bitrate=
585.0kbits/s speed=4.65x
frame= 697 fps=139 q=31.0 size= 1687kB time=00:00:24.04 bitrate=
574.8kbits/s speed=4.78x
frame= 771 fps=139 q=30.0 size= 1840kB time=00:00:26.07 bitrate=
578.2kbits/s speed=4.72x
frame= 846 fps=140 q=30.0 size= 2003kB time=00:00:28.08 bitrate=
584.3kbits/s speed=4.65x
frame= 912 fps=139 q=30.0 size= 2155kB time=00:00:31.08 bitrate=
567.9kbits/s speed=4.75x
frame= 982 fps=139 q=30.0 size= 2384kB time=00:00:33.09 bitrate=
590.2kbits/s speed= 4.7x
frame= 1051 fps=139 q=30.0 size= 2548kB time=00:00:35.09 bitrate=
594.6kbits/s speed=4.65x
frame= 1120 fps=139 q=30.0 size= 2697kB time=00:00:37.10 bitrate=
595.5kbits/s speed=4.61x
frame= 1186 fps=139 q=30.0 size= 2883kB time=00:00:39.25 bitrate=
601.6kbits/s speed=4.59x
frame= 1258 fps=139 q=30.0 size= 3055kB time=00:00:42.11 bitrate=
594.2kbits/s speed=4.65x
frame= 1333 fps=139 q=29.0 size= 3207kB time=00:00:44.12 bitrate=
595.4kbits/s speed=4.62x
frame= 1401 fps=139 q=29.0 size= 3363kB time=00:00:46.14 bitrate=
596.9kbits/s speed=4.59x
frame= 1466 fps=139 q=29.0 size= 3532kB time=00:00:49.13 bitrate=
588.8kbits/s speed=4.65x
frame= 1537 fps=139 q=28.0 size= 3680kB time=00:00:51.14 bitrate=
589.5kbits/s speed=4.62x
frame= 1559 fps=138 q=-1.0 Lsize= 3989kB time=00:00:52.12 bitrate=
627.0kbits/s speed=4.62x
video:3119kB audio:813kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 1.448805%
[libx264 @ 0x7fd821822600] frame I:12 Avg QP:24.46 size: 8829
[libx264 @ 0x7fd821822600] frame P:419 Avg QP:26.64 size: 4157
[libx264 @ 0x7fd821822600] frame B:1128 Avg QP:29.56 size: 1193
[libx264 @ 0x7fd821822600] consecutive B-frames: 1.9% 3.0% 6.2% 89.0%
[libx264 @ 0x7fd821822600] mb I I16..4: 49.9% 0.0% 50.1%
[libx264 @ 0x7fd821822600] mb P I16..4: 23.3% 0.0% 0.0% P16..4: 49.3%
0.0% 0.0% 0.0% 0.0% skip:27.3%
[libx264 @ 0x7fd821822600] mb B I16..4: 3.4% 0.0% 0.0% B16..8: 19.2%
0.0% 0.0% direct: 7.1% skip:70.3% L0:35.8% L1:43.1% BI:21.2%
[libx264 @ 0x7fd821822600] final ratefactor: 23.53
[libx264 @ 0x7fd821822600] coded y,uvDC,uvAC intra: 45.2% 40.8% 10.6%
inter: 9.6% 8.2% 0.3%
[libx264 @ 0x7fd821822600] i16 v,h,dc,p: 74% 13% 7% 6%
[libx264 @ 0x7fd821822600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 27% 10% 3%
3% 4% 3% 3% 5%
[libx264 @ 0x7fd821822600] i8c dc,h,v,p: 48% 16% 31% 6%
[libx264 @ 0x7fd821822600] Weighted P-Frames: Y:14.6% UV:3.6%
[libx264 @ 0x7fd821822600] kb/s:491.59
[aac @ 0x7fd82182bc00] Qavg: 1142.250
$ ffmpeg -i issue5493.mp4 -filter:v framerate=30,scale=640:360,fps=30 -b:v
500k -pass 2 -y test.mp4
ffmpeg version N-80335-gcb46b78 Copyright (c) 2000-2016 the FFmpeg
developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --enable-gpl --enable-nonfree --disable-ffserver
--enable-openssl --enable-libspeex --enable-libopus --enable-libfdk-aac
--enable-libx265 --enable-libx264 --enable-libxvid --enable-libfaac
--enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx
--enable-libvidstab --extra-cflags=-I/sw/include --extra-libs=-L/sw/lib
libavutil 55. 24.100 / 55. 24.100
libavcodec 57. 46.100 / 57. 46.100
libavformat 57. 38.100 / 57. 38.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 46.101 / 6. 46.101
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'issue5493.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2016-04-24 09:48:33
location : +60.4916+022.2685/
location-eng : +60.4916+022.2685/
com.android.version: 6.0.1
Duration: 00:00:52.12, start: 0.000000, bitrate: 15880 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1920x1080, 15715 kb/s, SAR 1:1 DAR 16:9, 25.48 fps, 90k tbr, 90k tbn, 180k
tbc (default)
Metadata:
creation_time : 2016-04-24 09:48:33
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 196 kb/s (default)
Metadata:
creation_time : 2016-04-24 09:48:33
handler_name : SoundHandle
[Parsed_framerate_0 @ 0x7fe522422e60] time base:1/90000 -> 1/90000 exact:1
[Parsed_framerate_0 @ 0x7fe522422e60] fps -> fps:30/1 scene score:7.000000
interpolate start:15 end:240
[libx264 @ 0x7fe523001200] using SAR=1/1
[libx264 @ 0x7fe523001200] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX
[libx264 @ 0x7fe523001200] profile High, level 3.0
[libx264 @ 0x7fe523001200] 264 - core 148 r2699 a5e06b9 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2016 - 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=11
lookahead_threads=1 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=25
scenecut=40 intra_refresh=0 rc_lookahead=40 rc=2pass mbtree=1 bitrate=500
ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 cplxblur=20.0 qblur=0.5
ip_ratio=1.40 aq=1:1.00
[mp4 @ 0x7fe523000000] Using AVStream.codec to pass codec parameters to
muxers is deprecated, use AVStream.codecpar instead.
Last message repeated 1 times
Output #0, mp4, to 'test.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
com.android.version: 6.0.1
location : +60.4916+022.2685/
location-eng : +60.4916+022.2685/
encoder : Lavf57.38.100
Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021),
yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 500 kb/s, 30 fps, 15360 tbn,
30 tbc (default)
Metadata:
creation_time : 2016-04-24 09:48:33
handler_name : VideoHandle
encoder : Lavc57.46.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/500000 buffer size: 0 vbv_delay: -1
Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz,
stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2016-04-24 09:48:33
handler_name : SoundHandle
encoder : Lavc57.46.100 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 52 fps=0.0 q=31.0 size= 119kB time=00:00:02.35 bitrate=
416.1kbits/s speed= 4.7x
frame= 113 fps=113 q=30.0 size= 267kB time=00:00:04.01 bitrate=
544.6kbits/s speed=4.01x
frame= 177 fps=117 q=30.0 size= 433kB time=00:00:06.02 bitrate=
589.2kbits/s speed=3.99x
frame= 235 fps=117 q=30.0 size= 552kB time=00:00:08.02 bitrate=
563.5kbits/s speed=3.99x
frame= 293 fps=116 q=30.0 size= 678kB time=00:00:10.03 bitrate=
553.7kbits/s speed=3.99x
frame= 349 fps=115 q=30.0 size= 842kB time=00:00:12.03 bitrate=
572.7kbits/s speed=3.98x
frame= 407 fps=115 q=30.0 size= 1039kB time=00:00:14.04 bitrate=
606.0kbits/s speed=3.98x
frame= 467 fps=116 q=30.0 size= 1166kB time=00:00:16.04 bitrate=
595.3kbits/s speed=3.98x
frame= 525 fps=116 q=30.0 size= 1328kB time=00:00:18.05 bitrate=
602.5kbits/s speed=3.98x
frame= 579 fps=115 q=30.0 size= 1515kB time=00:00:20.05 bitrate=
618.7kbits/s speed=3.99x
frame= 636 fps=115 q=30.0 size= 1704kB time=00:00:21.08 bitrate=
662.0kbits/s speed=3.81x
frame= 697 fps=115 q=30.0 size= 1850kB time=00:00:23.06 bitrate=
657.1kbits/s speed=3.82x
frame= 755 fps=115 q=30.0 size= 1979kB time=00:00:25.07 bitrate=
646.7kbits/s speed=3.83x
frame= 814 fps=115 q=30.0 size= 2119kB time=00:00:27.07 bitrate=
641.1kbits/s speed=3.84x
frame= 875 fps=116 q=30.0 size= 2261kB time=00:00:29.08 bitrate=
637.0kbits/s speed=3.85x
frame= 930 fps=115 q=30.0 size= 2438kB time=00:00:31.08 bitrate=
642.5kbits/s speed=3.86x
frame= 987 fps=115 q=30.0 size= 2594kB time=00:00:33.09 bitrate=
642.0kbits/s speed=3.86x
frame= 1048 fps=115 q=30.0 size= 2741kB time=00:00:35.09 bitrate=
639.7kbits/s speed=3.87x
frame= 1104 fps=115 q=30.0 size= 2877kB time=00:00:37.10 bitrate=
635.1kbits/s speed=3.87x
frame= 1158 fps=115 q=30.0 size= 3040kB time=00:00:39.10 bitrate=
636.8kbits/s speed=3.88x
frame= 1219 fps=115 q=30.0 size= 3175kB time=00:00:41.11 bitrate=
632.6kbits/s speed=3.88x
frame= 1279 fps=115 q=30.0 size= 3293kB time=00:00:42.82 bitrate=
630.0kbits/s speed=3.86x
frame= 1340 fps=116 q=30.0 size= 3423kB time=00:00:44.78 bitrate=
626.1kbits/s speed=3.87x
frame= 1401 fps=116 q=30.0 size= 3569kB time=00:00:46.34 bitrate=
630.8kbits/s speed=3.83x
frame= 1461 fps=116 q=30.0 size= 3686kB time=00:00:48.13 bitrate=
627.3kbits/s speed=3.82x
frame= 1522 fps=116 q=30.0 size= 3807kB time=00:00:50.16 bitrate=
621.7kbits/s speed=3.83x
[libx264 @ 0x7fe523001200] 2nd pass has more frames than 1st pass (1559)
[libx264 @ 0x7fe523001200] continuing anyway, at constant QP=27
[libx264 @ 0x7fe523001200] disabling adaptive B-frames
[libx264 @ 0x7fe523001200] specified frame type is not compatible with max
B-frames
$ x264 --version
x264 0.148.2699 a5e06b9
(libswscale 4.1.100)
(libavformat 57.38.100)
built on Jun 15 2016, gcc: 4.2.1 Compatible Apple LLVM 7.0.2
(clang-700.1.81)
x264 configuration: --bit-depth=8 --chroma-format=all
libx264 configuration: --bit-depth=8 --chroma-format=all
x264 license: GPL version 2 or later
libswscale/libavformat license: nonfree and unredistributable
WARNING: This binary is unredistributable!
}}}
To be honest I'm deeply reluctant to try out various older x264 releases
because
- I'm brainwashed to use ffmpeg git HEAD, so why not do the same for the
tools in the ffmpeg toolbox? (unless it's a clear cut bug)
- from the outside looking in it _does_ look like a filter regression, at
least appending `fps` to chain should not trigger the issue at all
shouldn't it?
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5493#comment:10>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list