Log in

View Full Version : Getting undesired FPS and AR output with QTGMC de-interlacer


Pages : 1 [2]

jackoneill
11th February 2017, 21:40
The moving dots are called dot crawl. If you look at the various black contours you'll also spot rainbows. These are two symptoms of the same problem: at some point the video went through some analog equipment. The luma and chroma were transmitted through the same cable and they were not adequately separated. Some of the chroma bled into the luma signal and produced the moving dots. Some of the luma bled into the chroma and produced the rainbows.

These problems can be filtered out perfectly using TComb, but only in scenes with no motion. Scenes with motion will still have them. QTGMC may help a little, as you've discovered.

VS_Fan
12th February 2017, 06:52
Here are screenshots. I am guessing that, for the trained eye, it something obvious that I am missing.Those, as jackoneill stated, are dot crawls. Also, there are rainbows around the lighning. TComb will help. It must be used before IVTC. Here's for you to try in avisynth:
source = "test3.d2v"
MPEG2Source(d2v=source)
TComb()

deinterlaced = nnedi3()

TFM(d2v=source, clip2=deinterlaced, mode=5, PP=4) #, display=True)
TDecimate(mode=1) #, display=True)
SMDegrain(contrasharp=True) I added (SMDegrain) a little bit of motion compensated temporal denoising followed by some sharpening (contrasharp=True). This will help with this problem too, and with some temporal noise I saw in your first samples.

KingLir
12th February 2017, 16:18
Thank you both again.

I tried what you suggested (and several subset of these) but the only script that seems to "do the trick" for me, meaning to remove the artifacts AND "interlaced" horizontal lines from all frames ( using the above code from VS_Fan left some frames with horizontal lines - you can see that yourself if applied on the sample I posted above ) was the following.
Does it seems OK to you ? Any disadvantages I should know about ?

TComb(mode=2)
TFM(mode=1).TDecimate(mode=1)
QTGMC(Preset="Very Slow", FPSDivisor=2)

ndjamena
12th February 2017, 16:50
I haven't read the full thread and don't really know what's going on but...

a = QTGMC.selecteven

tfm(slow=2, clip2=a)).TDecimate(mode=1)

bicubicresize(width/2, height)
spline36resize(width*2,height)

Mystery Keeper
12th February 2017, 17:09
I can not quietly read this anymore.
1) This is VapourSynth forum. If you want to discuss specific AviSynth script - please go to AviSynth Usage forum.
2) Deinterlacing won't get you rid of dot crawl and rainbows. What will reduce them - is temporal denoising (AKA motion-compensated denoising) with analyzing done on luma only. You need to do it in interlaced mode. Meaning you need to separate fields, denoise both of them, then weave them again. Do that after IVTC and before deinterlacing.
3) IVTC should give you progressive frames. But in harsh reality there are almost always combed frames left after it. Mostly due to crappy montage/mastering. You can deinterlace only combed frames and leave progressive frames intact. But it will result in ugly flicker. My heart bleeds every time I do it, but I have to always deinterlace the whole video in such cases. I lose details, but get no flicker.

feisty2
12th February 2017, 17:14
3) IVTC should give you progressive frames. But in harsh reality there are almost always combed frames left after it. Mostly due to crappy montage/mastering. You can deinterlace only combed frames and leave progressive frames intact. But it will result in ugly flicker. My heart bleeds every time I do it, but I have to always deinterlace the whole video in such cases. I lose details, but get no flicker.

you don't have to, you can deinterlace only combed frames and reinterpolate those frames with MFlowInter (if the neighboring frames are healthy..)

Mystery Keeper
12th February 2017, 17:17
you don't have to, you can deinterlace only combed frames and reinterpolate those frames with MFlowInter (if the neighboring frames are healthy..)This very moment I'm thinking of something like that. Can you give an example please?

KingLir
12th February 2017, 17:19
I can not quietly read this anymore.
1) This is VapourSynth forum. If you want to discuss specific AviSynth script - please go to AviSynth Usage forum..

Sorry for that, the discussion slipped away since several members pointed out that IVTC through Avisynth (TIVTC) have advantages over Vapoursynth (VIVTC). It should end with this last question I posted.


2) Deinterlacing won't get you rid of dot crawl and rainbows. What will reduce them - is temporal denoising (AKA motion-compensated denoising) with analyzing done on luma only. You need to do it in interlaced mode. Meaning you need to separate fields, denoise both of them, then weave them again. Do that after IVTC and before deinterlacing..

Yeah, already got that and therefore posted that last script.


3) IVTC should give you progressive frames. But in harsh reality there are almost always combed frames left after it. Mostly due to crappy montage/mastering. You can deinterlace only combed frames and leave progressive frames intact. But it will result in ugly flicker. My heart bleeds every time I do it, but I have to always deinterlace the whole video in such cases. I lose details, but get no flicker.

Thanks, that's explain things. So this is exactly what I am doing now, right ? ( the last script I wrote) and the disadvantage is losing a bit of the details ?

EDIT: I Missed fiesty2 respond. I would be happy to know how to do this as well !

VS_Fan
12th February 2017, 17:27
Thanks, that's explain things. So this is exactly what I am doing now, right ? ( the last script I wrote) and the disadvantage is losing a bit of the details ?[/B]It's a matter of taste, compromise. You put in each side of a balance:

IVTC and some cleanup (TComb + SMDegrain): Keeping the whole vertical resolution at the cost of some "horizontal lines"
Using QTGMC single-rated (IVTC + QTGMnC): Get rid of some "horizontal lines" sacrificing half of the vertical resolution
QTGMC (very-slow) uses nnedi3. nnedi3 (Neural network edge directed interpolation -3rd gen.-) is a very smart intra-field only deinterlacer. It takes in a frame, throws away one field, and then interpolates the missing pixels using only information from the kept field. If you use single-frame rated (FPSDivisor=2) QTGMC, You are discarding half the vertical resolution. To keep the whole resolution, use QTGMC with double-framerate!

On the other hand, the recommended IVTC uses TFM to match fields, and only for those frames whose field matches are detected as "combed" (interlaced: the frame MIC > MI parameter), it uses post-processing (nnedi3), discarding one field.

I prefer keeping the whole vertical resolution, and the same frame-rate, at the cost of getting some “combed” frames, taking into account that "combed" frames are only frequent on bad edited material, particularly at the beginning in the presentation/ introduction of the videos, where they combine hard-telecined materials as source producing inconsistent telecine patterns.

Mystery Keeper
12th February 2017, 17:29
and the disadvantage is losing a bit of the details ?]No. That's an understatement. Not losing a bit of details, but repainting (guessing) half of each frame.

ndjamena
12th February 2017, 18:04
Over on the VideoHelp forum, Jagabo sometimes recommends reducing the width by half to remove dot crawl. Analog doesn't really have a horizontal resolution and anything showing signs of dot crawl most likely doesn't have enough to justify full DVD resolution anyway so the damage done by shrinking it probably won't be missed. I just tried it on Dilbert and it worked really well where checkmate had failed.

I don't know what the TDecimate was for and just copied it from the previous posts.

I wouldn't have said anything but the thought of passing a video through three separate deinterlacers made my head hurt.

VS_Fan
12th February 2017, 18:06
Here's my VapourSynth version of the script, IVTC with post-processing, after Myrsloik's post (https://forum.doom9.org/showthread.php?p=1795527#post1795527):
import vapoursynth as vs
import functools
import havsfunc as ha
core = vs.get_core()
input_clip = core.d2v.Source(input="test3.m2v.d2v", rff=False) #, threads, nocrop, rff)
input_clip = core.tcomb.TComb(clip=input_clip, mode=2, fthreshl=2, fthreshc=4, othreshl=2, othreshc=4, scthresh=14) #, map)
# TComb parameters a bit relaxed to avoid artifacts... Try

def postprocess(n, f, clip, deinterlaced):
if f.props['_Combed'] > 0:
return deinterlaced
else:
return clip

matched_clip = core.vivtc.VFM(input_clip, order=1, mode=5, micout=True, micmatch=2, mi=108, cthresh = 12, scthresh = 14)
# micmatch, mi, cthresh & scthresh made more tolerant to avoid post-processing of frames with good matches marked as "_Combed = 1"
#ret = matched_clip

deinterlaced_clip = core.nnedi3.nnedi3(matched_clip, field=1)
#ret = deinterlaced_clip

postprocessed_clip = core.std.FrameEval(matched_clip, functools.partial(postprocess, clip=matched_clip, deinterlaced=deinterlaced_clip), prop_src=matched_clip)
#ret = postprocessed_clip

decimated_clip = core.vivtc.VDecimate(postprocessed_clip)
ret = decimated_clip

ret = ha.SMDegrain(ret, thSAD=400, contrasharp=True)

#core.text.FrameProps(clip=ret) .set_output()
ret.set_output()

I used "ret" and FrameProps to inspect the TFM metrics

KingLir
12th February 2017, 23:39
Thank you all.
VS_Fan, is your script does the same as what feisty2 suggested ?

you don't have to, you can deinterlace only combed frames and reinterpolate those frames with MFlowInter (if the neighboring frames are healthy..)

VS_Fan
13th February 2017, 03:43
Thank you all.
VS_Fan, is your script does the same as what feisty2 suggested ?Yes and No.

Yes because The concept is the same. Only frames detected as "combed" are post-processed. This script uses nnedi3 to interpolate half a frame, based on one field.

And No, because Feisty suggests something more: after deinterlacing (or discarding?) the "combed" frames, he suggests to re-interpolate them, by means of MFlowInter, based on the neighboring frames, provided those are fine.

KingLir
13th February 2017, 17:53
Yes and No.

Yes because The concept is the same. Only frames detected as "combed" are post-processed. This script uses nnedi3 to interpolate half a frame, based on one field.

And No, because Feisty suggests something more: after deinterlacing (or discarding?) the "combed" frames, he suggests to re-interpolate them, by means of MFlowInter, based on the neighboring frames, provided those are fine.

I see. From what you understood, Feisty's way will also leave some "combed" frames ?

VS_Fan
14th February 2017, 00:44
I see. From what you understood, Feisty's way will also leave some "combed" frames ?Yes, and the rate of false positives and false negatives can be regulated using the “mi” and “cthresh” parameters in VFM. The values I used were a good balance between false positives/ false negatives, for your tests of source videos (similar to those of mine):

With the default values for those parameters (or less), too many good frames were post-processed (false positives). Bad! It was discarding half the vertical resolution for too many good frames.
Relaxing them a bit (with values greater than the defaults), allowed frames with good matches to go without post-processing, very Good! But in small problematic areas of the video (bad edits at the beginning), that don’t follow a consistent telecine pattern, it resulted in a few perceptible “combed” frames passing undetected (false negatives).

KingLir
14th February 2017, 08:27
Yes, and the rate of false positives and false negatives can be regulated using the “mi” and “cthresh” parameters in VFM. The values I used were a good balance between false positives/ false negatives, for your tests of source videos (similar to those of mine):


Thank you for clearing this up.
So, incase one is fine with doubling the fps, no real disadvantages to go with QTGMC 2x for these type of materials ? and than add some duplicate frames to reach 59.94 (instead of 47.94), like this:

TComb(mode=2)
TFM(mode=1).TDecimate(mode=1)
QTGMC(Preset="Very Slow")
ChangeFPS(60000, 1001)

OR it's better to skip IVTC, in this case, completely ?

TComb(mode=2)
QTGMC(Preset="Very Slow")

Sharc
14th February 2017, 11:00
How should we know what kind of flaws you "prefer":
Judder, ghosts, blend, dotcrawl ....... It also depends how you are going to watch it (TV, PC)
Just try and judge yourself.

My (simple or simplistic) proposal would still be

Tcomb(mode=2) #or some other dotcrawl/rainbow filter, if at all
TFM(mode=1).TDecimate(mode=1)
QTGMC(InputType=1) #for cleaning up

But this is just me, of course .....

KingLir
14th February 2017, 11:43
QTGMC(InputType=1) #for cleaning up

But this is just me, of course .....

Thanks, but this leave some "combed" frames and QTGMC(Preset="Very Slow")
doesn't.

I aim for TV experience.