Log in

View Full Version : Simplest QTGMC script, please help!


videonyb
2nd November 2017, 10:40
Hi! Sorry for a dumb question...

Please, give me a simple template of avisynth script, that uses QTGMC for doubling fps (I mean bob fps for smooth progressive video).

Suppose I have 1920x1080i 29.97fps video with Top field first order. And I want to convert this video to smooth progressive 720p 59.94 fps

As I understand it'd be smth like that?

Import("C:\Program Files (x86)\AviSynth\plugins\QTGMC.avsi")
Import("C:\Program Files (x86)\AviSynth\plugins\xMsxYztR.avsi")
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\nnedi3.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\RemoveGrain.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\mvtools2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\masktools2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\DePan.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\DePanEstimate.dll")
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll")
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\lsmash\LSMASHSource.dll")
LWLibavVideoSource("C:\TEST.mp4")
AssumeTFF()
LanczosResize(1280,720) # Lanczos (Sharp)
QTGMC(Preset="Slow")

Am I right? All these plugins need to be loaded or not? Are these last three lines correct?

StainlessS
2nd November 2017, 11:07
EDIT: QTGMC is a de-interlacer.

Is your clip interlaced ?, using any resize before QTGMC would suggest that it is not interlaced (as this would destroy the clip, mix fields)
If interlaced then could use your script with the resize AFTER QTGMC, or if not interlaced see here:- http://forum.doom9.org/showthread.php?t=174793

EDIT: NOTE, I dont use Avs+, but I think that it does autoload plugins in the default plugins directory, however it does not autoload avsi
scripts, so you could probably remove all of the loadplugin lines of your script (but not the Import lines).

EDIT: Also, the version of QTGMC that you have should tell of plugin requirements, there are many versions.

Groucho2004
2nd November 2017, 11:26
NOTE, I dont use Avs+, but I think that it does autoload plugins in the default plugins directory, however it does not autoload avsi
scripts
Huh? Where did that come from?

videonyb
2nd November 2017, 11:56
EDIT: QTGMC is a de-interlacer.

Is your clip interlaced ?, using any resize before QTGMC would suggest that it is not interlaced (as this would destroy the clip, mix fields)
If interlaced then could use your script with the resize AFTER QTGMC, or if not interlaced see here:- http://forum.doom9.org/showthread.php?t=174793


Interlaced of course, as I said 1920x1080i

OK, I move resize function at the end of the script.


AssumeTFF()
QTGMC(Preset="Slow")
LanczosResize(1280,720) # Lanczos (Sharp)

That's all I have to do?

*I use AviSynth 2.6. Probably autoload isnt working for me, but it's not a problem to load more plugins than required, right?

StainlessS
2nd November 2017, 11:59
Hi G2K4, there, I took this lot :- https://forum.doom9.org/showthread.php?p=1820820#post1820820
to mean that auto load of avsi did not work.

EDIT:
That's all I have to do?
Thats all I would do.

Groucho2004
2nd November 2017, 12:22
Hi G2K4, there, I took this lot :- https://forum.doom9.org/showthread.php?p=1820820#post1820820
to mean that auto load of avsi did not work.As far as I recall, this only applies to AVSIs that try to read global variables. Scripts like QTGMC work fine.

StainlessS
2nd November 2017, 12:36
Scripts like QTGMC work fine.

sweet :)

videonyb
2nd November 2017, 16:48
Interesting, if I put resize function before QTGMC it's still working and convert 25i to 50p, but with worse quality.

lansing
2nd November 2017, 17:27
Interesting, if I put resize function before QTGMC it's still working and convert 25i to 50p, but with worse quality.

Resizing before deinterlacing is wrong, it did not work.

real.finder
2nd November 2017, 17:54
Interesting, if I put resize function before QTGMC it's still working and convert 25i to 50p, but with worse quality.

you must NOT use resize in interlaced source, there are some Function but i lost it now

real.finder
2nd November 2017, 23:54
I find it now and updated it https://pastebin.com/yBZaFVB9

IResize(1280,720,resifilter="LanczosResize")

edit: new update https://forum.doom9.org/showpost.php?p=1823545&postcount=5

manono
3rd November 2017, 04:04
Interlaced of course, as I said 1920x1080i

Which means nothing by itself. The content can be progressive. It can be hard telecined. And it can actually be interlaced.

In addition, you've made several uninformed statements so, how about an untouched sample? 10 seconds or so with steady movement.

Interesting, if I put resize function before QTGMC it's still working and convert 25i to 50p, but with worse quality.

You said originally the question was about a 29.97fps source. Did you switch without telling anyone?

Tempter57
3rd November 2017, 04:21
Interesting, if I put resize function before QTGMC it's still working and convert 25i to 50p, but with worse quality.
It is possible to lower the area of handling for QTGMC so:
AssumeTFF()
LanczosResize(1280, Last.Height)
QTGMC(preset="Slow")
LanczosResize(Last.Width, 720)

videonyb
6th November 2017, 13:46
Which means nothing by itself. The content can be progressive. It can be hard telecined. And it can actually be interlaced.

In addition, you've made several uninformed statements so, how about an untouched sample? 10 seconds or so with steady movement.
Video is 100% interlaced.


You said originally the question was about a 29.97fps source. Did you switch without telling anyone?

I have some different sources. Some TV-capture streams are 25fps whereas video from camera is 29.97fps.

It is possible to lower the area of handling for QTGMC so:
AssumeTFF()
LanczosResize(1280, Last.Height)
QTGMC(preset="Slow")
LanczosResize(Last.Width, 720)

Thanks. It'd be faster, I think.

But my question was about using QTGMC after full resize. If it's incorrect, why it works?

manolito
6th November 2017, 14:27
But my question was about using QTGMC after full resize. If it's incorrect, why it works?

It does work in the sense that it will not crash and produce some output. But resizing a truly interlaced clip (where the 2 fields originate from different points in time) VERTICALLY will inevitably destroy the temporal information by mixing the fields. If your source is really interlaced (not just flagged as interlaced) then the output quality will be terrible.
Never ever resize interlaced clips vertically...

If you need to resize an interlaced clip vertically, use a script made for this purpose. There is IResize (link is a few posts above by real.finder, or there is a somewhat simpler script by stickboy from his jdl-interlace.avsi).


Cheers
manolito

manono
8th November 2017, 08:47
Some TV-capture streams are 25fps...
And those could easily be phase-shifted and progressive, needing only to be field-matched and not deinterlaced. It happens all the time with PAL TV broadcasts. Again, before going off and doing the wrong thing, better might be to produce some short and untouched samples for examination.

But my question was about using QTGMC after full resize. If it's incorrect, why it works?
If it's actually working, then it's not interlaced. Or your eyes are very bad. manolito is absolutely right. Again, samples.

videonyb
10th November 2017, 20:43
Oh, God, Megui detects video as interlaced, every frame has clearly visible combing...what else do I need?

I have plenty of different videos...it's senseless to check a single sample...

https://ufile.io/uhomp

Groucho2004
10th November 2017, 22:00
But my question was about using QTGMC after full resize. If it's incorrect, why it works?
I used the sample you posted and stacked 2 clips, the top one has the resize before QTGMC, the bottom one has the resize after QTGMC. Here (https://www.dropbox.com/s/n142k9eoxw7vh63/test.mkv?dl=0) is the clip.

Script:
AssumeTFF()
a = last
b = a
a = a.LanczosResize(1280,720)
a = a.QTGMC(preset = "Medium")
b = b.QTGMC(preset = "Medium")
b = b.LanczosResize(1280,720)
StackVertical(a, b)
Spline36Resize(640, 720)
trim(440, 540)
assumefps(20, 1)


So, you'll have to elaborate on what you consider "it works".

LemMotlow
10th November 2017, 22:02
AssumeTFF()
QTGMC(preset="super fast")
iResize(1280,720)

Groucho2004
10th November 2017, 22:11
AssumeTFF()
QTGMC(preset="super fast")
iResize(1280,720)
iRezize works pretty well but I think you want to modify your script a little. :D

videonyb
11th November 2017, 00:05
I used the sample you posted and stacked 2 clips, the top one has the resize before QTGMC, the bottom one has the resize after QTGMC. Here (https://www.dropbox.com/s/n142k9eoxw7vh63/test.mkv?dl=0) is the clip.

Script:
AssumeTFF()
a = last
b = a
a = a.LanczosResize(1280,720)
a = a.QTGMC(preset = "Medium")
b = b.QTGMC(preset = "Medium")
b = b.LanczosResize(1280,720)
StackVertical(a, b)
Spline36Resize(640, 720)
trim(440, 540)
assumefps(20, 1)


So, you'll have to elaborate on what you consider "it works".

Ok, I got the same result. Sometimes it works sometimes not.

I have to investigate what's going on here))

**Why do you trim clip at the end of the script? I always put it before all other functions. It makes no difference, right?

StainlessS
11th November 2017, 04:20
It makes no difference, right?
QTGMC is temporal in nature, so trim at end allows QTGMC access to frames external to trim region at either end of clip.
whereas it would not have access to those (few) frames if trimmed at beginning of script.

EDIT: Having said above, I'de probably have put it at beginning before anything else.

Groucho2004
11th November 2017, 09:40
It makes no difference, right?
The trim was simply for the purpose of picking a section with motion, I didn't put much thinking into it.

videonyb
14th November 2017, 21:05
Hmm. I decided to change DAR of the video without any resize, just to leave it as it is. Source is 720x576i PAL w/o any black borders that may should be cropped.

MeGUI with its clever anamorphic function set this:

# Set DAR in encoder to 160 : 117. The following line is for automatic signalling

160:117 ~ 1.3675 while I need DAR 4:3=1.3333

Should I manually set this values instead of what MeGUI proposes?

global MeGUI_darx = 4
global MeGUI_dary = 3

manono
15th November 2017, 00:31
Is there an option somewhere to choose non-ITU resizing. If so, that should give you what you want.

Just out of curiosity, why do you 'need' 1.33:1?