I have a problem with this footage because after deinterlacing it keeps flickering because the luma (and chroma) of each two adjacent frames obtained after deinterlacing differ significantly. Any advice on how to handle this issue is welcome.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 12 of 12
Thread
-
-
How did you deinterlace it? I see no flickering myself.
Can't you bob it with a decent double-rate deinterlacer? -
The bottom field seems to be slightly darker (or more saturated, or higher contrast) than the top field. Try to tweak one of the fields to align it visually with the other field.
Perhaps something like
Code:AssumeTFF() QTGMC() e=selecteven().tweak(bright=1.0,sat=1.015).SMDegrain() o=selectodd().SMDegrain() interleave(e,o) vinverse()
Last edited by Sharc; 31st May 2021 at 09:23.
-
Thank you Sharc for your effort. I just thought perhaps this issue is known and there is some filter to deal with that. Also, in static scenes it's more visible that picture in the bottom field is kinda skewed and it introduces some slight shaking which is not visible in dynamic scenes.
I would also like to read some explanation why these issues are present because I like to learn and understand. -
The deflicker filters I know of adjust by the average brightness of the frames. But in this video the difference in brightness varies along the vertical axis. So adjusting the average will still leave some flickering. I averaged the first 1024 frames together (blurred), subtracted the two fields to get a spacial map of the average difference in brightness, then used that to adjust one of the fields, making it match the other. That worked pretty well:
Code:####################################################################### # # Average 1024 blurred frames (really fields as used here) together # to get a single frame with the average brightness. # ####################################################################### function AverageLuma1024(clip v) { v.BilinearResize(16,72) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) BilinearResize(v.width, v.height) Trim(0, length=1) } ####################################################################### Mpeg2Source("sample.d2v", CPU2="ooooxx", Info=3) sep = SeparateFields() adjust = Subtract(sep.SelectEven().AverageLuma1024(), sep.SelectOdd().AverageLuma1024()).ColorYUV(off_y=-121).GreyScale() SeparateFields() e = SelectEven() e = Overlay(e, adjust, mode="Subtract").ColorYUV(off_y=5) o = SelectOdd() Interleave(e,o) Weave() QTGMC() #######################################################################
-
Thanks a lot jagabo for this elegant solution. Are these luma offsets (-121 and 5) manually adjusted? Also, this solves brightness issue but I still find problematic the fact that every second field is skewed or whatever it is compared with the first one. In static scenes it's more visible that picture is shaking slightly. Is there a way to fix this problem?
-
Yes. If you examine a Histogram() of the mask just after Subtract() you'll see most of the values around 128:
[Attachment 59230 - Click to enlarge]
If you added that with Overlay() many pixels would be way over 255. If you subtracted many pixels would be less than 0. So I pulled the brightness down to bring the darkest pixels to zero (ignoring the crap at the top and bottom of the frame):
[Attachment 59231 - Click to enlarge]
After subtracting that from the even fields the whole fields was a little darker than the odd fields. So I added 5 units back to Y.
The best way to fix that is with a line time base corrector in your capture chain. But this comes pretty close:
Code:SeparateFields() e = SelectEven() o = SelectOdd().HShear(0.4) Interleave(e,o) Weave()
-
One more question... Why did you downscale the input to (16, 72) in the averaging function? Is it due to computational efficiency or something else?
Last edited by Santuzzu; 3rd Jun 2021 at 13:43.
-
-
Originally Posted by Santuzzu
Code:####################################################################### # # Average 1024 blurred frames (really fields as used here) together # to get a single frame with the average brightness. # ####################################################################### function AverageLuma1024(clip v) { v.BilinearResize(16,72) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) Merge(SelectEven(), SelectOdd()) BilinearResize(v.width, v.height) Trim(0, length=1) } ####################################################################### Mpeg2Source("sample.d2v", CPU2="ooooxx", Info=3) sep = SeparateFields() #adjust = Subtract(sep.SelectEven().AverageLuma1024(), sep.SelectOdd().AverageLuma1024()).ColorYUV(off_y=-121).GreyScale() #return(adjust) adjust = AviSource("sample.adjust.avi") SeparateFields() e = SelectEven() e = Overlay(e, adjust, mode="Subtract").ColorYUV(off_y=5) o = SelectOdd() Interleave(e,o) Weave() QTGMC()
Similar Threads
-
Problem deinterlacing AVI file dubbed from VHS
By crbd98 in forum RestorationReplies: 8Last Post: 12th Mar 2021, 11:42 -
The problem with deinterlacing or pulldown
By Smart Jason in forum DVD RippingReplies: 56Last Post: 25th Jan 2021, 13:14 -
ffmpeg luma only
By luki14 in forum Video ConversionReplies: 4Last Post: 5th Jun 2020, 01:02 -
Deinterlacing problem
By hintlou in forum DVD RippingReplies: 8Last Post: 16th Mar 2020, 06:51 -
Problem with Deinterlacing/Fieldmatching
By pub0 in forum Video ConversionReplies: 5Last Post: 23rd Aug 2017, 12:47