View Full Version : How to use FQRestore?
PiPPoNe92
17th October 2015, 18:58
Hello, I'd like to restore a DVD video and after different research I found FQSharp filter from: http://www.avisynth.nl/users/vcmohan/FQSharp/FQRestore.html
and I tried to use it for restoring an DVD5 video but i think I do some mistakes.
My script is this (I cutted off not important parts):
LoadPlugin("Plugins\LoadDll.dll")
LoadCPlugin("Plugins\ffms2.dll")
LoadDll("Plugins\libfftw3f-3.dll")
LoadDll("Plugins\fftw3.dll")
...
LoadPlugin("plugins\FQSharp.dll")
Directshowsource("DVD5.mkv", fps=25.000)
ConvertToYV12
Spline64Resize(1088,576)
#assumefieldbased()
#separatefields()
FQRestore()
My aim is obtaining a result as written below "effect of amount of motion blur
below are results. Left is blurred image. Right restored image " on author's page.
Here you can download filters and test file: https://www.mediafire.com/folder/fpedoa8o2kdbo/TEST
I tried to use separatefields() ect.. but it creates strange lines for motion vector analysis. Thank you in advance.
bxyhxyh
18th October 2015, 16:12
use it on progressive video like this
#other filter
AssumeFieldBased()
FQRestore(settings)
AssumeFrameBased()
#other filters
Use it on video that have to be sharpened by field
SeparateFields()
#other filters that work on fields
FQSharpen(settings)
#other filters that work on fields
Weave()
Video brightness depends on wn, fr, scale settings. So you have to test settings many times to match its brightness to source.
StainlessS
18th October 2015, 18:41
LoadDll("Plugins\libfftw3f-3.dll")
LoadDll("Plugins\fftw3.dll")
That is the same dll and needs to be in system32 (or SysWOW64 on 64 bit), and should not be loaded as a plugin (because it is not one).
FFT3DFilter needs it to be named "fftw3.dll", other plugins require it to be named "libfftw3f-3.dll".
EDIT: What is LoadDll ?
Reel.Deel
18th October 2015, 19:27
EDIT: What is LoadDll ?
From the readme.txt: used to load dll files in avisynth. Useful if a filter rely on an external dll that are not in the system PATH.
Here's the thread (http://forum.doom9.org/showthread.php?t=119200) and you can download it from here (http://www.avisynth.nl/users/tsp/).
StainlessS
18th October 2015, 20:06
Thanx RD, I read LoadDll but my brain heard LoadPlugin.
Not sure that I like the LoadDll idea, but I guess for portable application it could be handy.
PiPPoNe92
19th October 2015, 09:30
I used your first script:
use it on progressive video like this
#other filter
AssumeFieldBased()
FQRestore(settings)
AssumeFrameBased()
#other filters
Thanks bxyhxyh, in my output there are lines near motion zones because of motion compensation...I use this filter in the wrong way. Can you see me an example with some filters so I can understand how it works?
vcmohan
19th October 2015, 13:21
FQRestore is a frequency domain deterministic filter. When the geometry of blur : circle and radius in case of out of focus, or direction and amplitude in case of blur caused by motion are known, then the filter inverts the filter . If the input blur type or amplitudes are not known correctly, the results most likely be unacceptable. I struggled with this several times to improve, but gave up. However one user (I think Fiesty) wanted it to be ported to vapoursynth and pushed me to it, and he informed me he uses FQRestore almost regularly. So it appears it works on some inputs.
The default call FQRestore() assumes an out of focus type blur with a radius of 2 pixels. As suggested above by others you need to experiment with unless you know the amount (and direction of the motion) of blur.
Inversion can lead to instabilities as in real world all frequencies may not be present. The parameter wn is to get over that problem but it thereby reduces effectiveness of filtering also.
f you can devout time please experiment. It will be heartening if this plugin function is of use.r
bxyhxyh
19th October 2015, 14:16
I used your first script:
Thanks bxyhxyh, in my output there are lines near motion zones because of motion compensation...I use this filter in the wrong way. Can you see me an example with some filters so I can understand how it works?
Yes. I saw that.
Those lines are rings created by FQSharp. Maybe because too strong scale and wrong settings?
I've never used it to fix motion blur.
I used it only as generic sharpener. (line=false)
You would need to add padding(2,2,2,2) before you sharpen it. Crop it after you sharpen it. Because it creates halo on four sides of the video.
For your example
FFVideoSource("C:\Users\Balj\Desktop\DVD5.mkv")
Spline36Resize(1088,576)
padding(2,2,2,2)
AssumeFieldBased()
FQRestore(line=false,scale=0.2,fr=1.4,wn=0.444)
AssumeFrameBased()
crop(2,2,-2,-2)
http://screenshotcomparison.com/comparison/147441
EDIT: FQRestore(line=true,scale=0.2,fr=1.4,wn=0.30) works ok for me.
PiPPoNe92
23rd October 2015, 23:44
thank you so much bxyhxyh. It works. It is what i was searching. Finally, I can make some restoring ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.