View Full Version : Can a filter (e.g. QTGMC ) be skipped at run-time?
Mitra
13th February 2022, 17:06
I have a script that feeds my player like this:
FFMS2("s.ts")
QTGMC()
It works, but it's very slow when seeking to different positions (with a slider), although I need a fast seek.
my question:
Is it possible to skip/ignore QTGMC filter when the player is seeking/paused?
OR
Is it possible to change and apply the script at run-time?
kedautinh12
13th February 2022, 17:43
Here is fastest ver of QTGMC:
https://github.com/Dogway/Avisynth-Scripts/blob/master/MIX%20mods/QTGMC.avsi
Mitra
13th February 2022, 21:04
@kedautinh12, Thanks for your reply, I use the same but not fast enough to seek. (my source is 1080i50)
I need to control the Avisynth filters from my player, but I do not know how.
StainlessS
13th February 2022, 21:07
From RT_Stats,
RT_GetProcessName(bool "parent"=false,bool "debug"=false)
Returns string, name of current process eg "VirtualDubMod.exe" or "AvsPMod.exe" or name of parent process
(the one that started our process eg "Explorer.exe"). Debug outputs some info to DebugView.
Returns String, if error returns -ve int error code.
Call QTGMC dependent upon process name.
Untested
FFMS2("s.ts")
Proc = RT_GetProcessName()
Assert(Proc.IsString,"RT_GetProcessName, Error="+String(Proc))
(Proc!="PotPlayer.Exe") ? QTGMC() : Last
Return Last
Mitra
13th February 2022, 21:32
From RT_Stats,
RT_GetProcessName(bool "parent"=false,bool "debug"=false)
Returns string, name of current process eg "VirtualDubMod.exe" or "AvsPMod.exe" or name of parent process
(the one that started our process eg "Explorer.exe"). Debug outputs some info to DebugView.
Returns String, if error returns -ve int error code.
Call QTGMC dependent upon process name.
Untested
Proc = RT_GetProcessName()
Assert(Proc.IsString,"RT_GetProcessName, Error="+String(Proc))
(Proc!="PotPlayer.Exe") ? QTGMC() : Last
Thanks, I was not aware of that, and a big thank you for creating such a great functions, but I honestly did not understand how your script works for what I need.
StainlessS
13th February 2022, 21:37
If running in PotPlayer then it dont call QTGMC(), if not then does call QTGMC().
you would have to test against all your player process names.
(Potplayer [proc name PotPlayer.Exe] is a media player)
Process name is the one shown via Task Manager, or CTRL/SHIFT/ESCape.
Or
FFMS2("s.ts")
Proc = RT_GetProcessName()
Assert(Proc.IsString,"RT_GetProcessName, Error="+String(Proc)) # check for Error getting Process name
(Proc=="PotPlayer.Exe" || Proc=="MPC-HC (x64).Exe") ? Last : QTGMC() # if "PotPlayer" or "MPC-HC (x64)" then skip QTGMC() else call it
Return Last
Change the names depending upon which players you use.
Mitra
13th February 2022, 21:53
If running in PotPlayer then it dont call QTGMC(), if not then does call QTGMC().
you would have to test against all your player process names.
(Potplayer is a media player)
Process name is the one shown via Task Manager, or CTRL/SHIFT/ESCape.
Thanks, but I want to skip QTGMC in one player at run-time, but the RT_GetProcessName always returns myPlayer.exe and cannot get a signal/command from my player,
I mean : I wrote my video player using ffmpeg API that feeds by Avisynth, now how can I say to the script something like this :
if (my player is playing)
{return QTGMC}
else
if (my player is paused/seeking)
{return Last }
sorry for my bad English.
Mitra
13th February 2022, 22:02
@StainlessS, If it was possible to rename the process whenever the player was running, I could use it, but unfortunately this is not the case.
StainlessS
13th February 2022, 22:33
OK, you want to know if seeking or whatever, sorry cant help.
[Dont think you are going to have much luck with that]
(I had read your post earlier, but forgot your requirement,
I only posted after kedautinh12 post, and did not re-read requirement)
Mitra
13th February 2022, 22:48
OK, you want to know if seeking or whatever, sorry cant help.
[Dont think you are going to have much luck with that]
(I had read your post earlier, but forgot your requirement,
I only posted after kedautinh12 post, and did not re-read requirement)
:( ,Thank you so much for your time.
I wish I could send keyboard keys to filters at run-time to control them.:(
Zarxrax
13th February 2022, 22:55
If its a player that you wrote yourself, is it possible to have it load two scripts? One of the scripts would have QTGMC disabled, and you would pull frames from that when seeking. Then when you begin playback, swap to the other script. Not sure if its feasible, but just an idea.
Mitra
13th February 2022, 23:02
If its a player that you wrote yourself, is it possible to have it load two scripts? One of the scripts would have QTGMC disabled, and you would pull frames from that when seeking. Then when you begin playback, swap to the other script. Not sure if its feasible, but just an idea.
Thanks for the idea, but I've done this before, and unfortunately it takes about 0.7 second when loading and replacing the sources / scripts.
Frank62
13th February 2022, 23:08
If I understand right: You want to watch, sometimes seek, and again watch. So why do these 0.7 seconds matter? :confused:
Mitra
13th February 2022, 23:20
If I understand right: You want to watch, sometimes seek, and again watch. So why do these 0.7 seconds matter? :confused:
The video is playing in slow motion for many people in a hall and should not be interrupted.
I'm curious to know if this can be done with Avisynth or not,but I'm disappointed.
Zarxrax
13th February 2022, 23:23
Its a little curious that you can play the video in realtime with qtgmc but the seeking performance is not good enough. I wouldn't expect seeking to use that much more resources than playback, but maybe I'm wrong.
Have you tried tweaking the qtgmc settings to make it perform faster, or is it possible to use a quicker filter instead of qtgmc?
Mitra
13th February 2022, 23:33
Its a little curious that you can play the video in realtime with qtgmc but the seeking performance is not good enough. I wouldn't expect seeking to use that much more resources than playback, but maybe I'm wrong.
Have you tried tweaking the qtgmc settings to make it perform faster, or is it possible to use a quicker filter instead of qtgmc?
Yes, of course , I tried tweaking the qtgmc settings to make it perform faster and my machine is very fast, but seeking is not fast enough for my 1080i50 sources.
also, tried some another filters, but the qtgmc has better quality for what i want.
Mitra
13th February 2022, 23:43
These are my questions:
Can a filter (e.g. QTGMC ) be skipped/ignored at run-time?
OR
Is it possible to skip/ignore QTGMC filter when the player is seeking/paused?
OR
Is it possible to change and apply the script at run-time?
But unfortunately, their answer seems to be NO.
I compiled Avisynth+ CUDA to get better performance, but could not use qtgmc please see this my post (https://forum.doom9.org/showthread.php?t=183811).
wonkey_monkey
14th February 2022, 00:29
Thanks for the idea, but I've done this before, and unfortunately it takes about 0.7 second when loading and replacing the sources / scripts.
You can extract multiple clips programatically from one AviSynth environment, then switch between them instantly for display. E.g., have a script which says:
source = AviSource("source.avi")
_preview = source
return source.QTGMC()
The return value of the script will be the QTGMC'd clip, but you can use env->Invoke to get a PClip for _preview.
kedautinh12
14th February 2022, 01:39
If you use Avs cuda, you can try KTGMC
https://github.com/pinterf/AviSynthCUDAFilters/tree/master/TestScripts
Or you can try another faster filter like
yadifmod2:
https://github.com/Asd-g/yadifmod2
BWDIF:
https://github.com/Asd-g/AviSynth-BWDIF
Mitra
14th February 2022, 08:14
You can extract multiple clips programatically from one AviSynth environment, then switch between them instantly for display. E.g., have a script which says:
source = AviSource("source.avi")
_preview = source
return source.QTGMC()
The return value of the script will be the QTGMC'd clip, but you can use env->Invoke to get a PClip for _preview.
I'll try it,thanks.
Mitra
14th February 2022, 08:30
If you use Avs cuda, you can try KTGMC
https://github.com/pinterf/AviSynthCUDAFilters/tree/master/TestScripts
Or you can try another faster filter like
yadifmod2:
https://github.com/Asd-g/yadifmod2
BWDIF:
https://github.com/Asd-g/AviSynth-BWDIF
I tried both the yadifmod2 and BWDIF, they are fast but their quality is not good for me.
I compiled and installed AVS+Cuda without any problems, but when run this script:
FFMS2("s.ts")
onCUDA()
KTGMC()
gives this error:
This Avisynth does not support memory type 2 (CUDA)
(m.avs, line 2)
m.avs: Unknown error occurred
and with this:
FFMS2("s.ts")
KTGMC()
onCUDA()
gives this error:
Evaluate: Unhandled C++ exception!
(C:/Program Files (x86)/AviSynth+/plugins64+/KTGMC.avsi, line 451)
(m.avs, line 2)
m.avs: Unknown error occurred
and this is line 449~451 of KTGMC.avs :
449- bobbed = (InputType == 0) ? useEdiExt ? isyuy2(EdiExt) ? EdiExt.nonyuy2clipin(true) : EdiExt : planarClip.KTGMC_Bob( 0,0.5 ) : \
450- (InputType == 1) ? planarClip : \
451- planarClip.Blur( 0,1 )
i don't know how to solve the errors. :(
kedautinh12
14th February 2022, 08:44
You can ask pinterf some problem about avs cuda
https://forum.doom9.org/showthread.php?t=181351
Mitra
14th February 2022, 08:53
You can ask pinterf some problem about avs cuda
https://forum.doom9.org/showthread.php?t=181351
Thanks, I'll ask him.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.