Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th March 2023, 14:52   #941  |  Link
lollo2
Registered User
 
lollo2's Avatar
 
Join Date: Aug 2017
Location: Italy
Posts: 113
Quote:
Probably because QTGMC is trying really hard to make these smooth antialiased lines everywhere so that just naturally results in more contiguous moire bands and I'm not sure there is any solution to that.
I agree, and I do not see a simple solution rather than playing with QTGMC parameters
__________________
A channel on S-VHS / VHS capture and AviSynth restoration https://www.youtube.com/channel/UCMs...h1MmNAs7I8nu4g
lollo2 is offline   Reply With Quote
Old 10th March 2023, 15:23   #942  |  Link
coolgit
Registered User
 
Join Date: Apr 2019
Posts: 217
Quote:
Originally Posted by flossy_cake View Post
I see QTGMC has a ton of parameters that can be fine tuned - does anyone know which ones might affect moire? I'm talking about this sort of thing: https://imgsli.com/MTYxMTM3 (look at her left sleeve... it's more noticeable in motion)

Tried playing with some of the nnedi3 search radius params without success. Here is the source clip: https://drive.google.com/file/d/15UX...ew?usp=sharing
Try turning off QTGMC parameters to off, one by one until there is no moire.
coolgit is offline   Reply With Quote
Old 10th March 2023, 15:51   #943  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by flossy_cake View Post
And yes I do acknowledge that if we interpolate fields to progressive frames with Bob() or bwdif() there will be moire artefacts too, but they are a lot less intense than QTGMC. Probably because QTGMC is trying really hard to make these smooth antialiased lines everywhere so that just naturally results in more contiguous moire bands and I'm not sure there is any solution to that.

bwdif looks pretty bad and intense in terms of moire too. That's why you shouldn't deinterlace progressive material . I know this series has other problems in some scenes, but IVTC with TFM(pp=0) looks better

For me, the moire is very distracting ; more distracting than other artifacts
poisondeathray is offline   Reply With Quote
Old 11th March 2023, 01:10   #944  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Quote:
Originally Posted by poisondeathray View Post
bwdif looks pretty bad and intense in terms of moire too.
Yes however I find the severity is lower with bwdif, maybe because I am using thr=2 which requires more motion before switching from weave to bob (default is thr=0, higher number = more weaving, but potentially more combing artefacts).

Also make sure you have the latest version of bwdif as that clip I uploaded is BFF and there was a recent bugfix for BFF video: https://github.com/Asd-g/AviSynth-BW...ent-1407702275

Quote:
Originally Posted by poisondeathray View Post
That's why you shouldn't deinterlace progressive material . I know this series has other problems in some scenes, but IVTC with TFM(pp=0) looks better
Oh I know. The only reason I'm not using IVTC is because this particular DVD release of this show has this field alignment issue and I'm trying to get a smoothing effect to reduce it, which QTGMC seems to provide. I can smooth it by using the deflicker filter instead, but then image is quite soft, whereas QTGMC smooths but also maintains sharpness, but then that extra sharpness seems to come at the cost of moire.

imo bwdif(field=-2, thr=2, pass=true, edeint=nnedi3(field=-2)) is quite a bit superior to QTGMC, and very cheap on the CPU. I think some sources look better without the edeint param tho, eg. if the source already has antialiasing baked into it, then the nnedi3 pixels just make it look a bit softer. But for very sharp unfiltered 480i/576i then I would say nnedi3 pixels look subjectively "better".

Last edited by flossy_cake; 11th March 2023 at 01:13.
flossy_cake is offline   Reply With Quote
Old 12th March 2023, 14:29   #945  |  Link
coolgit
Registered User
 
Join Date: Apr 2019
Posts: 217
I had this before and rechecked what I did to solve it.

InputType=0 or 2 or 3 created moire but InputType=1 was superb.

I used this:- QTGMC(preset="Medium", InputType=1, sourceMatch=3, sharpness=0.2, tr2=2, ediThreads=8)

Filters like MAA2, DAA, HQDeringmod() made it slightly worse and Sangnom2 created moire as same as InputType=0 or 2 or 3
coolgit is offline   Reply With Quote
Old 13th March 2023, 03:33   #946  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Quote:
Originally Posted by coolgit View Post
I had this before and rechecked what I did to solve it.

InputType=0 or 2 or 3 created moire but InputType=1 was superb.

I used this:- QTGMC(preset="Medium", InputType=1, sourceMatch=3, sharpness=0.2, tr2=2, ediThreads=8)

Filters like MAA2, DAA, HQDeringmod() made it slightly worse and Sangnom2 created moire as same as InputType=0 or 2 or 3
Thanks for that.

It seems that with InputType=1 there is no deinterlacing done, so we must feed it progressive frames with TFM(PP=0).TDecimate() beforehand. So InputType>0 is really just a "repair pixels" mode for progressive frames - that's useful for me as I want to repair the field alignment issue mentioned in Babylon 5.

I found that InputType=1 would not repair the field alignment issue at all, but InputType=2/3 does repair it (but SourceMatch must by >0 for it to work).

But the downside is I am seeing shimmer/flicker on moving pixels (like you would get with mocomp deinterlacing - moving parts of the image dropping to half vertical res) and there is still some moire on her sleeve that the simple nnedi3 blend solution doesn't have:

https://imgsli.com/MTYxODI2
https://imgsli.com/MTYxODI3

Again for context: the source video has field alignment issue and the whole purpose of using QTGMC was only to repair the field alignment issue without softening the picture too much and without introducing significant moire artefacts.
flossy_cake is offline   Reply With Quote
Old 18th March 2023, 15:46   #947  |  Link
coolgit
Registered User
 
Join Date: Apr 2019
Posts: 217
TDeint and eedi filters creates moire. Also when using pel or subpel parameters. ie. pel=1 or 2 or 4, avoid using pel=1 as it creates slight moire. Use pel=2 is best.

You mentioned Babylon 5, done that. Most of the frames are progressive according to TFM. Interlaced is common on space scenes, badly out of focus and damage scenes - generally have bigger black borders compare to progressive live scenes. Use TFM then QTGMC.
coolgit is offline   Reply With Quote
Old 20th March 2023, 12:24   #948  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Does anyone have any tips for the best settings when using QTGMC only for interpolated pixels, like eg. bwdif(edeint=qtgmc) or tdeint(edeint=qtgmc).

The best I've gotten so far is this:

Code:
LWLibavVideoSource("c:\480i 3-2.mkv", stream_index=-1, repeat=true, cache=true)

propDelete("_FieldBased").bwdif(field=-2, thr=2, edeint=QTGMC(preset="slow", Sharpness=0.0, SrchClipPP=0, Rep0=1))
Comparison vs without those last 3 params: https://imgsli.com/MTYzMzg0

The issue appears to be that QTGMC pixels are so different from original pixels, that using them as interpolated pixels is risky because they don't necessarily weave very nicely with original pixels, so you can get this aliasing/mice teeth effect. But those last 3 params seem to be mitigating it quite a bit, not sure why.

edit: for reference these are the pixels being interpolated, shown by bwdif(debug=true). I believe dark green means weave, the others like light green, pink etc. are interpolated, i.e swapped/blended for QTGMC pixels.

Last edited by flossy_cake; 20th March 2023 at 13:39.
flossy_cake is offline   Reply With Quote
Old 20th March 2023, 19:32   #949  |  Link
lollo2
Registered User
 
lollo2's Avatar
 
Join Date: Aug 2017
Location: Italy
Posts: 113
Not sure if it helps, but a setting trying to force QTGMC to "retain" original look can be something like:

Code:
QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, tr1=2, tr2=1, NoiseTR=2, sharpness=0.1)
__________________
A channel on S-VHS / VHS capture and AviSynth restoration https://www.youtube.com/channel/UCMs...h1MmNAs7I8nu4g
lollo2 is offline   Reply With Quote
Old 20th March 2023, 22:24   #950  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Ah yes, the source matching mode, also with lossless=1 setting. It definitely helps, but the performance penalty is quite high - precludes realtime use for me.

With stock settings I am surprised to find QTGMC is fast enough to run in realtime on "slow" and "slower". I'm seriously considering using it now for watching older DVDs that don't detelecine so well (dodgy ones with lots of weird edits, cadence breaks, video sections spliced in, etc.). The look of the QTGMC image can be stunning at times, very smooth almost artificial and dreamlike, but not in a bad way. I love that it produces 60p output so the frame pacing is perfect - all those 90's CGI and opening sequences animating perfectly how it was meant to look. Of course this comes at a price - not full 480p res, and some moire artefacts on stippled patterns. But God damn it looks really good at times. There's a certain softness and smoothness to the image.

Last edited by flossy_cake; 20th March 2023 at 22:28.
flossy_cake is offline   Reply With Quote
Old 25th March 2023, 21:11   #951  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
I am astonished to find that QTGMC also cleans up analogue dot crawl and rainbows better than any of the others dedicated filters like DeDot, TComb and DotKill.

After playing around for a couple of hours, DeDot and TComb seem to only work on static images - anything that moves still has dotcrawl on it. For animation this is quite noticeable. DotKillZ seems to work on moving objects but only treats every 2nd frame (and it says so in the wiki as well, I've no idea if this can be worked around by somehow stacking up 2 offset clips and interleaving them - I tried without success - just got blended frames coming out).

But QTGMC comes along and filters it out perfectly, and doesn't even mention it in the wiki.

Last edited by flossy_cake; 27th March 2023 at 16:58.
flossy_cake is offline   Reply With Quote
Old 27th March 2023, 13:10   #952  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
There is something weird that QTGMC does with 2:2 and 3:2 cadence video - it produces a geometric "warbling" on edges of moving objects. Seems to be something to do with the motion analysis part of QTGMC. If I step through each frame of the 60p output, rocking back and forth +/- 1 frame (field in the source) the shapes of objects are quite different between the two fields. Like a circle will be warbling slightly into an ellipse. At normal playback speed this warbling is unnoticeable. But it does seems to make very slow moving objects appear to have soap opera effect. It's like those tiny geometric distortions trick my brain into thinking there was a whole new intermediate frame in there, and it looks a bit like soap opera effect. It's extremely mild though, I'd imagine most people wouldn't notice it at all.

edit: here's an animated png showing it. The video source is 480i 3:2 TFF. The 3 images you're seeing are all from the 3 sequence in 3:2, so they all originate from the same progressive frame, yet it appears as though there are 3 separate images with motion. Notice the changing shape of the window skirting. Weirdly this is totally unnoticeable when played back at normal speed, so luckily it's not a dealbreaker as I otherwise love this plugin for lower quality sources.

Last edited by flossy_cake; 27th March 2023 at 16:59.
flossy_cake is offline   Reply With Quote
Old 28th March 2023, 18:32   #953  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Quote:
Originally Posted by poisondeathray View Post
bwdif looks pretty bad and intense in terms of moire too.
This might be superior to QTGMC alone - seems to resolve more resolution with less moire:


Code:
# weave static parts of image, nnedi3 interpolation on changing parts
propDelete("_FieldBased").bwdif(field=-2, thr=2, edeint=nnedi3(field=-2))


# QTGMC "progressive repair" mode to remove shimmering, aliasing & moire on changing pixels:
cores=4
QTGMC(InputType=1, preset="slow", Sharpness=1.0, FPSDivisor=1, EdiThreads=cores/2)
Prefetch(cores)
Fast enough for realtime use too

Downsides are QTGMC suppresses film grain, and the soap opera effect on very small movements of 2:2 or 3:2 cadence.

edit: test clip - https://drive.google.com/file/d/1WfW...usp=share_link
Note that 1px patterns are fully resolved (weaved) while motion (like the glasses frames) get the QTGMC smoothing - best of both worlds?

Last edited by flossy_cake; 28th March 2023 at 19:33.
flossy_cake is offline   Reply With Quote
Old 28th March 2023, 19:38   #954  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Why would you deinterlace source with 3:2 pulldown though?
Remove pulldown and you get "best" result possible.
kolak is offline   Reply With Quote
Old 28th March 2023, 20:38   #955  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Quote:
Originally Posted by kolak View Post
Why would you deinterlace source with 3:2 pulldown though?
If the source is clean and good 3:2 with minimal cadence breaks, yes absolutely TFM.TDecimate all the way.

But I've been buying a lot of DVDs of older TV shows lately and many are using multiple cadences (mixture of 3:2, 2:2 and 1:1 sections) have too much compression noise, rainbows, dotcrawl, field alignment issue etc. It's a nice option to just throw the deinterlacer at it and get a nice perfectly frame paced 60p with high quality antialiasing and smoothing. Solve all the issues in 1 hit.

Especially with the frame pacing, I spent days tuning my display modes in CRU to get no dropped frames only to end up with 41ms dropped frames here and there due to occasional cadence breaks in the source.

Even with a "good" source you will still be needing to handle the odd combed frame here or there and it makes those frames look nicer too so you don't have to worry so much about the false positives of combed frame detection

Code:
TFM(mode=0, slow=2, scthresh=100, PP=3, cthresh=9, MI=96,
\    clip2=propDelete("_FieldBased").bwdif(field=-1, thr=2, edeint=nnedi3(field=-1)))

TDecimate(mode=0, cycleR=1, cycle=5, hybrid=1, viddetect=2, vidthresh=4.5, 
\    denoise=true, chroma=false, hint=false)

QTGMC(InputType=1, preset="slow", FPSDivisor=1, EdiThreads=cores/2, Sharpness=1.0)
Prefetch(cores)

Last edited by flossy_cake; 8th May 2023 at 12:41.
flossy_cake is offline   Reply With Quote
Old 5th April 2023, 03:31   #956  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Does anyone know if it's possible to completely disable motion vectors in QTGMC? I think they are responsible for (1) geometric warbling and (2) soap opera effect on small movements, when playing 2:2 or 3:2 cadence video.

I am not sure if motion vectors are needed for other stuff QTGMC does, like shimmer reduction etc., so maybe my request is unreasonable.

I can avoid the issue by outputting half frame rate with FPSDivisor=2. But I want full frame rate, not half.

Maybe something in MVTools can be turned off?

edit: Rep0=13 seems to suppress the effect:

Scene 1 (slow camera pan): default , Rep0=13
Scene 2 (medium camera pan): default , Rep0=13

Even though there is still a fair bit of geometric distortion, my brain cannot detect any soap opera effect from it on small movements, so that issue is solved.

I still don't know if the distortion is low enough to not trick TDecimate into thinking there was a whole new frame there.

edit: well here is what I consider to be the best deinterlacing mode in Avisynth. I reckon it gives TIVTC a run for its money, and is fast enough for real time use:

Code:
propdelete("_FieldBased").bwdif(field=-2, thr=2, edeint=nnedi3(field=-2))
QTGMC(InputType=1, preset="slow", Sharpness=1.0, Rep0=13, Border=true, EdiThreads=cores/2)
Prefetch(cores)
I did find that with the new Rep0=13 setting, there are some high frequency rainbow/dotcrawl patterns that don't get smoothed as well as the default Rep0 setting, but that is a price I am willing to pay.

Last edited by flossy_cake; 5th April 2023 at 07:50.
flossy_cake is offline   Reply With Quote
Old 19th May 2023, 16:46   #957  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
What does QTGMC stand for?
flossy_cake is offline   Reply With Quote
Old 19th May 2023, 16:50   #958  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 702
Quote:
Originally Posted by flossy_cake View Post
What does QTGMC stand for?
Quick Temporal Gauss Motion Compensation?
anton_foy is offline   Reply With Quote
Old 19th May 2023, 16:54   #959  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Yes. Once upon a time, Didée modified TempGaussMC.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 5th June 2023, 10:16   #960  |  Link
Citaln
Registered User
 
Join Date: Apr 2023
Posts: 3
I had some border problems that took me quite a while to troubleshoot. I thought I had someone misaligned the fields on the first/last lines only. I was using border=true and I really don't understand why it does what it does, as an example:
Code:
White = BlankClip(length=1,width=40,height=160,color=$FFFFFF)
Black = BlankClip(length=1,width=40,height=160,color=$000000)

BlankClip(length=1,width=40,height=160,color=$FFFFFF)
StackHorizontal(Last,Black)
StackHorizontal(Last,Black)
Frame1 = StackHorizontal(Last,Black)

BlankClip(length=1,width=40,height=160,color=$000000)
StackHorizontal(Last,White)
StackHorizontal(Last,Black)
Frame2 = StackHorizontal(Last,Black)

BlankClip(length=1,width=40,height=160,color=$000000)
StackHorizontal(Last,Black)
StackHorizontal(Last,White)
Frame3 = StackHorizontal(Last,Black)

BlankClip(length=1,width=40,height=160,color=$000000)
StackHorizontal(Last,Black)
StackHorizontal(Last,Black)
Frame4 = StackHorizontal(Last,White)

Interleave(Frame1,Frame2,Frame3,Frame4)

SeparateFields().SelectEvery(4,0,3).Weave()

converttoYV16

qtgmc(border=true)
With border true, the bottom and top lines are just plain 50% of the previous or next field. Is this correct/intended?
Citaln is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.