[FFmpeg-user] Pullup filter is introducing chroma lag

Paul B Mahol onemda at gmail.com
Wed Mar 9 09:50:13 EET 2022


On 3/8/22, morgan holly via ffmpeg-user <ffmpeg-user at ffmpeg.org> wrote:
>
>
>> On Mar 8, 2022, at 12:07 PM, Paul B Mahol <onemda at gmail.com> wrote:
>>
>> On 3/8/22, morgan holly via ffmpeg-user <ffmpeg-user at ffmpeg.org
>> <mailto:ffmpeg-user at ffmpeg.org>> wrote:
>>> Hi,
>>>
>>> I’m trying to remove telecine from a prores mov file using the pullup
>>> filter:
>>>
>>> Source file:
>>> Video: prores (LT), top coded first (swapped)), 720x480, 29.97 fps, 29.97
>>> tbr, 30k tbn, 30k tbc (default)
>>>
>>> Command:
>>> ffmpeg -i pullup_test.mov -an -vf pullup -r 24000/1001 -pix_fmt yuv420p
>>> -y
>>> pullup_test1.mov
>>>
>>> Result:
>>> Every fourth frame on the 23.976 output has chroma lag (3/2 removed from
>>> luma, but chroma is still interlaced). Dejudder doesn’t fix it and
>>> fieldmatch+decimate does worse things.
>>>
>>> Test sources:
>>> I’ve seen the artifact on both live action and clean animation sources. I
>>> cannot share the sources but created a short example that can be used to
>>> recreate the issue:
>>>
>>> Test source with 3/2:
>>> http://videopress.s3.amazonaws.com/misc/pullup_test.mov
>>> <http://videopress.s3.amazonaws.com/misc/pullup_test.mov
>>> <http://videopress.s3.amazonaws.com/misc/pullup_test.mov>>
>>>
>>> Test pullup 23.976 output:
>>> http://videopress.s3.amazonaws.com/misc/pullup_test_1.mov
>>> <http://videopress.s3.amazonaws.com/misc/pullup_test_1.mov>
>>> <http://videopress.s3.amazonaws.com/misc/pullup_test_1.mov
>>> <http://videopress.s3.amazonaws.com/misc/pullup_test_1.mov>>
>>>
>>> Thanks for any help!
>>>
>>> FFMPEG output:
>>>
>>> ffmpeg -i /Volumes/Drive5/videopress_testing/pullup_test.mov -an -vf
>>> pullup
>>
>> Your input is yuv422p10, thus use format filter before
>> pullup/fieldmatch to get proper results.
>>
>> Pullup and fieldmatch internally works only with 8 bit depth formats,
>> (fieldmatch additionally supports post processing input that can be
>> used to get back 10 bit output)
>>
>> thus -vf format=yuv422p,pullup .... is one possible processing version.
>>
>> Otherwise, yuv420p is picked and pullup/fieldmatch get yuv420p
>> processing of auto inserted scale filter which is not aware that input
>> is telecined, and messes up the chroma plane when downsampling to
>> worse quality pixel format.
>
> That fixed it Paul! Thank you. So, you’re saying the internal processing of
> pullup is limited to 8 bit? Then I would need truncate to filter then
> bit-stuff to get back to 10 bit for a ProRes output? Ouch.
>

Fieldmatch does have ppsrc option where it takes original 10bit and
downsampled 8bit input and process 10bit input according to 8bit
matching. Technically pullup could have same option but I'm not
motivated to work on strict GPL filters.

> Thanks again!
>
> Morgan
>
>
>>
>>
>>
>>> -r 24000/1001 -pix_fmt yuv420p -y
>>> /Volumes/Drive5/videopress_testing/pullup_test1.mov
>>> ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
>>>  built with Apple clang version 13.0.0 (clang-1300.0.29.3)
>>>  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4.1_3 --enable-shared
>>> --enable-pthreads --enable-version3 --cc=clang --host-cflags=
>>> --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl
>>> --enable-libaom
>>> --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus
>>> --enable-librav1e --enable-librist --enable-librubberband
>>> --enable-libsnappy
>>> --enable-libsrt --enable-libtesseract --enable-libtheora
>>> --enable-libvidstab
>>> --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp
>>> --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid
>>> --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r
>>> --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb
>>> --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq
>>> --enable-libzimg --disable-libjack --disable-indev=jack
>>> --enable-avresample
>>> --enable-videotoolbox
>>>  libavutil      56. 70.100 / 56. 70.100
>>>  libavcodec     58.134.100 / 58.134.100
>>>  libavformat    58. 76.100 / 58. 76.100
>>>  libavdevice    58. 13.100 / 58. 13.100
>>>  libavfilter     7.110.100 /  7.110.100
>>>  libavresample   4.  0.  0 /  4.  0.  0
>>>  libswscale      5.  9.100 /  5.  9.100
>>>  libswresample   3.  9.100 /  3.  9.100
>>>  libpostproc    55.  9.100 / 55.  9.100
>>> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
>>> '/Volumes/Drive5/videopress_testing/pullup_test.mov':
>>>  Metadata:
>>>    major_brand     : qt
>>>    minor_version   : 537199360
>>>    compatible_brands: qt
>>>    creation_time   : 2022-03-08T16:50:01.000000Z
>>>  Duration: 00:00:13.41, start: 0.000000, bitrate: 2465 kb/s
>>>  Stream #0:0(eng): Video: prores (LT) (apcs / 0x73637061),
>>> yuv422p10le(tv,
>>> smpte170m/smpte170m/bt709, top coded first (swapped)), 720x480, 1840
>>> kb/s,
>>> SAR 10:11 DAR 15:11, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc (default)
>>>    Metadata:
>>>      creation_time   : 2022-03-08T16:50:01.000000Z
>>>      handler_name    : Apple Video Media Handler
>>>      vendor_id       : appl
>>>      encoder         : Apple ProRes 422 LT
>>>      timecode        : 00:00:00;00
>>>  Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
>>>    Metadata:
>>>      creation_time   : 2022-03-08T16:50:01.000000Z
>>>      handler_name    : Time Code Media Handler
>>>      timecode        : 00:00:00;00
>>> Stream mapping:
>>>  Stream #0:0 -> #0:0 (prores (native) -> h264 (libx264))
>>> Press [q] to stop, [?] for help
>>> [libx264 @ 0x7fba5f822000] using SAR=10/11
>>> [libx264 @ 0x7fba5f822000] using cpu capabilities: MMX2 SSE2Fast SSSE3
>>> SSE4.2
>>> [libx264 @ 0x7fba5f822000] profile High, level 3.0, 4:2:0, 8-bit
>>> [libx264 @ 0x7fba5f822000] 264 - core 163 r3060 5db6aa6 - H.264/MPEG-4
>>> AVC
>>> codec - Copyleft 2003-2021 - 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=15
>>> 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=23
>>> 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
>>> [mov @ 0x7fba5f831400] Drop frame is only allowed with multiples of
>>> 30000/1001 FPS
>>> Output #0, mov, to '/Volumes/Drive5/videopress_testing/pullup_test1.mov':
>>>  Metadata:
>>>    major_brand     : qt
>>>    minor_version   : 537199360
>>>    compatible_brands: qt
>>>    encoder         : Lavf58.76.100
>>>  Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p(tv,
>>> smpte170m/smpte170m/bt709, top coded first (swapped)), 720x480 [SAR 10:11
>>> DAR 15:11], q=2-31, 23.98 fps, 24k tbn (default)
>>>    Metadata:
>>>      creation_time   : 2022-03-08T16:50:01.000000Z
>>>      handler_name    : Apple Video Media Handler
>>>      vendor_id       : appl
>>>      timecode        : 00:00:00;00
>>>      encoder         : Lavc58.134.100 libx264
>>>    Side data:
>>>      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
>>> frame=    2 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
>>> dup=1
>>> droframe=  323 fps=0.0 q=-1.0 Lsize=      82kB time=00:00:13.34 bitrate=
>>> 50.2kbits/s dup=3 drop=0 speed=26.7x
>>> video:78kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
>>> muxing overhead: 5.091292%
>>> [libx264 @ 0x7fba5f822000] frame I:2     Avg QP:13.12  size:   698
>>> [libx264 @ 0x7fba5f822000] frame P:212   Avg QP:21.95  size:   239
>>> [libx264 @ 0x7fba5f822000] frame B:109   Avg QP:22.99  size:   248
>>> [libx264 @ 0x7fba5f822000] consecutive B-frames: 39.9% 41.5% 11.1%  7.4%
>>> [libx264 @ 0x7fba5f822000] mb I  I16..4: 99.3%  0.0%  0.7%
>>> [libx264 @ 0x7fba5f822000] mb P  I16..4:  1.4%  0.6%  0.2%  P16..4:  0.7%
>>> 0.1%  0.0%  0.0%  0.0%    skip:96.9%
>>> [libx264 @ 0x7fba5f822000] mb B  I16..4:  0.6%  0.0%  0.0%  B16..8:  1.6%
>>> 0.2%  0.0%  direct: 0.4%  skip:97.2%  L0:50.7% L1:47.0% BI: 2.3%
>>> [libx264 @ 0x7fba5f822000] 8x8 transform intra:17.9% inter:49.4%
>>> [libx264 @ 0x7fba5f822000] coded y,uvDC,uvAC intra: 2.3% 19.4% 16.8%
>>> inter:
>>> 0.1% 0.5% 0.5%
>>> [libx264 @ 0x7fba5f822000] i16 v,h,dc,p: 69% 29%  1%  0%
>>> [libx264 @ 0x7fba5f822000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 15% 69%  0%
>>> 0%  0%  0%  0%  0%
>>> [libx264 @ 0x7fba5f822000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 27% 38%  0%
>>> 0%  0%  0%  0%  0%
>>> [libx264 @ 0x7fba5f822000] i8c dc,h,v,p: 45% 35% 18%  1%
>>> [libx264 @ 0x7fba5f822000] Weighted P-Frames: Y:0.0% UV:0.0%
>>> [libx264 @ 0x7fba5f822000] ref P L0: 52.8%  1.3% 28.8% 17.1%
>>> [libx264 @ 0x7fba5f822000] ref B L0: 80.9% 18.6%  0.6%
>>> [libx264 @ 0x7fba5f822000] ref B L1: 98.6%  1.4%
>>> [libx264 @ 0x7fba5f822000] kb/s:46.94
>>>
>>> _______________________________________________
>>> ffmpeg-user mailing list
>>> ffmpeg-user at ffmpeg.org <mailto:ffmpeg-user at ffmpeg.org>
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>> <https://ffmpeg.org/mailman/listinfo/ffmpeg-user>
>>>
>>> To unsubscribe, visit link above, or email
>>> ffmpeg-user-request at ffmpeg.org <mailto:ffmpeg-user-request at ffmpeg.org>
>>> with subject "unsubscribe".
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list