Opened 8 years ago

Closed 8 years ago

#5586 closed defect (fixed)

Blend Y variable issue

Reported by: Crystian Leão Owned by:
Priority: important Component: undetermined
Version: unspecified Keywords: blend regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When i use the blend filter, the Y variable in the formula works differently in 2.x and 3.x builds.
How to reproduce:
video 1: https://dl.dropboxusercontent.com/u/4096865/1.mp4
video 2: https://dl.dropboxusercontent.com/u/4096865/2.mp4

$ ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "blend=all_expr='if(gte((T+1)*H-Y,H),A,B)'" out.mp4

Basically, i tried all static 3.x builds and some static 2.x builds.

In 3.x builds, it produces a video like this: https://dl.dropboxusercontent.com/u/4096865/3x%20blend.mp4

In 2.x builds, it produces a video like this: https://dl.dropboxusercontent.com/u/4096865/2x%20blend.mp4

It's like if the Y variable were like a mod(Y,44), because this command bellow produces a similar results, in 2.x builds:

$ ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "blend=all_expr='if(gte((T+1)*H-mod(Y,44),H),A,B)'" out.mp4

and this video: https://dl.dropboxusercontent.com/u/4096865/2x%20blend%20with%20mod.mp4

Change History (5)

comment:1 by Crystian Leão, 8 years ago

Summary: bug witBlend Y variable issue

comment:2 by Carl Eugen Hoyos, 8 years ago

Keywords: regression added

Please test current FFmpeg git head and provide the command line that allows to reproduce the issue together with the complete, uncut console output.

comment:3 by Elon Musk, 8 years ago

Resolution: fixed
Status: newclosed

comment:4 by Crystian Leão, 8 years ago

Resolution: fixed
Status: closedreopened

Tested with latest mac os static build from website, this is the full console output, and it has the same result:

$ ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "blend=all_expr='if(gte((T+1)*H-Y,H),A,B)'" out.mp4

ffmpeg version N-79995-ge7a9b43-tessus Copyright (c) 2000-2016 the FFmpeg developers

built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --as=yasm --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb
libavutil 55. 23.100 / 55. 23.100
libavcodec 57. 38.100 / 57. 38.100
libavformat 57. 36.100 / 57. 36.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 44.100 / 6. 44.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':

Metadata:

major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.25.100

Duration: 00:00:02.95, start: 0.000000, bitrate: 929 kb/s

Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 414x414 [SAR 1:1 DAR 1:1], 867 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
Metadata:

handler_name : VideoHandler

Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 73 kb/s (default)
Metadata:

handler_name : SoundHandler

Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':

Metadata:

major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.25.100

Duration: 00:00:03.51, start: 0.000000, bitrate: 1163 kb/s

Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 414x414 [SAR 1:1 DAR 1:1], 1092 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
Metadata:

handler_name : VideoHandler

Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 72 kb/s (default)
Metadata:

handler_name : SoundHandler

[libx264 @ 0x7f8d8c002e00] using SAR=1/1
[libx264 @ 0x7f8d8c002e00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x7f8d8c002e00] profile High, level 3.0
[libx264 @ 0x7f8d8c002e00] 264 - core 148 - 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=6 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=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[mp4 @ 0x7f8d8c001c00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.

Last message repeated 1 times

Output #0, mp4, to 'out.mp4':

Metadata:

major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.36.100
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 414x414 [SAR 1:1 DAR 1:1], q=2-31, 30 fps, 15360 tbn (default)
Metadata:

encoder : Lavc57.38.100 libx264

Side data:

cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1

Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 69 kb/s (default)
Metadata:

handler_name : SoundHandler
encoder : Lavc57.38.100 aac

Stream mapping:

Stream #0:0 (h264) -> blend:top (graph 0)
Stream #1:0 (h264) -> blend:bottom (graph 0)
blend (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))

Press [q] to stop, ? for help
frame= 104 fps= 44 q=-1.0 Lsize= 306kB time=00:00:03.36 bitrate= 744.7kbits/s speed=1.43x
video:275kB audio:26kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.498923%
[libx264 @ 0x7f8d8c002e00] frame I:1 Avg QP:26.22 size: 13221
[libx264 @ 0x7f8d8c002e00] frame P:47 Avg QP:25.76 size: 4413
[libx264 @ 0x7f8d8c002e00] frame B:56 Avg QP:29.13 size: 1082
[libx264 @ 0x7f8d8c002e00] consecutive B-frames: 6.7% 57.7% 20.2% 15.4%
[libx264 @ 0x7f8d8c002e00] mb I I16..4: 6.1% 76.3% 17.6%
[libx264 @ 0x7f8d8c002e00] mb P I16..4: 0.5% 10.5% 2.6% P16..4: 47.1% 16.4% 5.7% 0.0% 0.0% skip:17.3%
[libx264 @ 0x7f8d8c002e00] mb B I16..4: 0.0% 0.4% 0.2% B16..8: 37.4% 3.5% 0.7% direct: 2.1% skip:55.7% L0:46.4% L1:47.3% BI: 6.3%
[libx264 @ 0x7f8d8c002e00] 8x8 transform intra:77.2% inter:76.1%
[libx264 @ 0x7f8d8c002e00] coded y,uvDC,uvAC intra: 84.3% 74.2% 14.6% inter: 20.0% 19.8% 0.1%
[libx264 @ 0x7f8d8c002e00] i16 v,h,dc,p: 8% 39% 2% 50%
[libx264 @ 0x7f8d8c002e00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 16% 12% 6% 13% 11% 14% 8% 11%
[libx264 @ 0x7f8d8c002e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 24% 15% 6% 11% 9% 10% 5% 6%
[libx264 @ 0x7f8d8c002e00] i8c dc,h,v,p: 59% 20% 15% 7%
[libx264 @ 0x7f8d8c002e00] Weighted P-Frames: Y:10.6% UV:2.1%
[libx264 @ 0x7f8d8c002e00] ref P L0: 61.1% 21.5% 10.3% 6.5% 0.5%
[libx264 @ 0x7f8d8c002e00] ref B L0: 92.7% 7.1% 0.1%
[libx264 @ 0x7f8d8c002e00] ref B L1: 100.0% 0.0%
[libx264 @ 0x7f8d8c002e00] kb/s:648.95
[aac @ 0x7f8d8a846c00] Qavg: 3639.638

comment:5 by Elon Musk, 8 years ago

Resolution: fixed
Status: reopenedclosed

That is not latest build.

Fixed in 5b8faaad6c71bbb90951ca1642391e11cf6f5f91.

Note: See TracTickets for help on using tickets.