View Full Version : Restoring low-quality Youtube/similar videos
JohannesL
10th May 2009, 13:28
Whoa, this looks great even on horrible 3D video game sources.
Thanks a bunch.
Ku2_BiO_X
2nd June 2009, 02:11
hello..
i tried the script but unsuccessful..
#LoadPlugin("C:\Documents and Settings\Ronaldo\Desktop\Remation\deblock.dll")
LoadPlugin("C:\Documents and Settings\Ronaldo\Desktop\Remation\dfttest.dll")
LoadPlugin("C:\Documents and Settings\Ronaldo\Desktop\Remation\Deen.dll")
LoadPlugin("C:\Documents and Settings\Ronaldo\Desktop\Remation\aWarpSharp.dll")
LoadPlugin("C:\Documents and Settings\Ronaldo\Desktop\Remation\Toon.dll")
LoadPlugin("C:\Documents and Settings\Ronaldo\Desktop\Remation\RemoveGrain.dll")
#LoadPlugin("C:\Documents and Settings\Ronaldo\Desktop\Remation\UnFilter.dll")
LoadPlugin("C:\Documents and Settings\Ronaldo\Desktop\Remation\Mt_MaskTools.dll")
LoadPlugin("C:\Documents and Settings\Ronaldo\Desktop\Remation\MaskTools.dll")
#LoadPlugin("C:\Documents and Settings\Ronaldo\Desktop\Remation\SangNom.dll")
LoadPlugin("C:\Documents and Settings\Ronaldo\Desktop\Remation\FFT3dGPU.dll")
Import("DeHalo_Alpha.avsi")
#Import("LimitedSharpenFaster.avs")
#Import("AAA.avsi")
#Import("Remation.avsi")
Import("FastLineDarken.avs")
DirectShowSource("test.flv")
Converttoyv12()
Deblock()
dfttest()
FastLineDarken()
deen("a3d",4,8,9)
Spline36Resize(last.width*2,last.height*2)
AddBorders(4, 0, 4, 0)
aWarpSharp(depth=12,blurlevel=4,thresh=0.2,cm=1)
FastLineDarken()
aWarpSharp(depth=6,blurlevel=4,thresh=0.7,cm=1)
Crop(4,0,-4,0)
FastLineDarken()
DeHalo_Alpha()
fft3dgpu(bt=3,sigma=8,sharpen=1.3)
Spline36Resize(last.width/2,last.height/2)
i keep getting error D3DERR_INVALIDCALL.. any suggestion?
edit: it's working now when i change fft3dgpu and use fft3dfilter using the same parameters..
i don't know whether this will give the same result, maybe slightly different..
Sagekilla
3rd June 2009, 00:47
Do you have fft3w.dll in your avisynth directory or in your system32 directory? Also, it's possible the GPU you have in your system isn't support by FFT3DGPU.
owais
3rd June 2009, 12:34
omg the first script in first post for me is very slow. is it a slow script?
sry for acting like baby
kemuri-_9
3rd June 2009, 16:00
omg the first script in first post for me is very slow. is it a slow script?
didn't you just answer your own question?
owais
3rd June 2009, 18:57
i dont understand how i will fix this green problem (had read sagekilla and Ranguvar post)
ok i sloved it
owais
3rd June 2009, 18:58
didn't you just answer your own question?
i was confirming whether it is really slow script or only on my computer it is slow
Dogway
5th January 2010, 20:38
Wow I really like this thread. The script works very nice but on really shitty crappy sources. It removed a lot of details on my source. So I dont know if this is only aimed to cartoons?
I made my own script to these kind of youtube videos. I realized that denoisers remove most of my blocking (if it's not too heavy), so I decided to not use deblock, because it just smooths away too much everything.
Well, I post my tests and script, so maybe I can improve it or you can take it for your own sources.
source (resized for comparison)
http://img691.imageshack.us/img691/729/sourceresized.th.png (http://img691.imageshack.us/img691/729/sourceresized.png)
dftest
http://img691.imageshack.us/img691/2519/dftest.th.png (http://img691.imageshack.us/img691/2519/dftest.png)
my script (encoded version, x264 removed banding further)
http://img685.imageshack.us/img685/1362/code.th.png (http://img685.imageshack.us/img685/1362/code.png)
ConvertToRGB.ChannelMixer(100, 0, 0,0, 100, 0, 0, 5, 100).ConvertToYV12
Tweak(sat=2,coring=false)
Levels(0, 1.2, 245, 0, 255, coring=false)
colorYUV(cont_y=40, cont_u=0, cont_v=0,gamma_y=0,gain_y=0)
Crop(6, 68, -4, -70)
tnlmeans(ax=4,ay=4,az=10,sx=2,sy=2,bx=1,by=1,a=2.0,sse=true) # very slow & best 4 anime
#ttempsmooth(maxr=7)
EEDI2() # for antialiasing
Lanczos4Resize(854, 480)
AddBorders(3,2,3,2,color=$000000)
mfToon(strength=10, sharpen=true, cwarp=false, wdepth=20, wblur=2, wthresh=0.5)
Crop(4, 2, -4, -2)
LimitedSharpenFaster(Smode=4, strength=20, edgemode=1, soft=-1)
GradFun2DBmod(thr=1.2,thrC=1.2,str=0.8,strC=0.4,radius=3,range=3,mode=3,temp=-1,mask=true,adapt=64)
farhanimator
4th February 2011, 19:52
Help me i m getting errors!! :(
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\deblock.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dfttest.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Deen.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\aWarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FFT3dGPU.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\DeHalo_alpha.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\FastLineDarken.avs")
DirectShowSource("D:\test.mp4", fps=23.976, audio=true, convertfps=true)
Converttoyv12()
Deblock()
dfttest()
FastLineDarken()
deen("a3d",4,8,9)
Spline36Resize(last.width*2,last.height*2)
AddBorders(4, 0, 4, 0)
aWarpSharp(depth=12,blurlevel=4,thresh=0.2,cm=1)
FastLineDarken()
aWarpSharp(depth=6,blurlevel=4,thresh=0.7,cm=1)
Crop(4,0,-4,0)
FastLineDarken()
DeHalo_Alpha()
fft3dgpu(bt=3,sigma=8,sharpen=1.3)
Spline36Resize(last.width/2,last.height/2)
xekon
16th October 2011, 01:32
Plugins have evolved a little a bit since 2008, Dark Shikari, have you updated or changed anything since then?
I have been commenting out lines 1 at a time to see what effect each of them has on the outcome, also have been adjusting values and swapping out filters here and there for alternatives.
having a hard time choosing between deen("a3d",4,8,9) and hqdn3d(13,13,2,3)
also swapped out some stuff
deblock() for DeBlock_QED()
aWarpSharp(depth=12,blurlevel=4,thresh=0.2,cm=1) for AWarpSharp2(128,4,0,44)
DeHalo_Alpha() for DeHalo_alpha(brightstr=2, ss=2.0)
FastLineDarken() is behaving strangely for me, so I left that out, I wonder if somebody has an alternative for it or a revised version.
Also I could not figure out the reason for using Spline36Resize
it doubles the size and then halves it toward the end... does this make the filters work more efficiently or something?
I can only assume that the AddBorders(4, 0, 4, 0) was only so that deblock had a mod 8 source.... DeBlock_QED() seems to work without worrying about that.
also is there any reason to use fft3dgpu() over FFT3DFilter()
Also DeBlock_QED uses masktools2 but DeHalo_alpha uses masktools 1.5.8, the dlls are named differently so I have them both in the plugins folder but it kinda worries me. Would be nice to have a DeHalo_alpha that works with masktools2, but if you try it will complain about an expand function missing.
I was looking at this (http://forum.doom9.org/showthread.php?t=132240) older thread and decided to try a slight modification of his script on some low quality Youtube and Nicovideo sources that I wanted to restore.
After and Before, respectively:
http://i29.tinypic.com/2ug1b11.png
Script:
Deblock()
dfttest()
FastLineDarken()
deen("a3d",4,8,9)
Spline36Resize(last.width*2,last.height*2)
AddBorders(4, 0, 4, 0)
aWarpSharp(depth=12,blurlevel=4,thresh=0.2,cm=1)
FastLineDarken()
aWarpSharp(depth=6,blurlevel=4,thresh=0.7,cm=1)
Crop(4,0,-4,0)
FastLineDarken()
DeHalo_Alpha()
fft3dgpu(bt=3,sigma=8,sharpen=1.3)
Spline36Resize(last.width/2,last.height/2)
This script is surprisingly effective :eek: It even works on blocky gradients, strangely enough, even though the original author designed it for cartoons.
Bloax
16th October 2011, 09:37
It should be easy enough to switch the MaskTools (1) functions with their MaskTools2 counterparts, but I'll just go ahead and do it for you.
Switching to MaskTools2 also provides a nice speed boost. So yeah, please confirm if I did break (or miss) something. :)
function DeHalo_alpha(clip clp, float "rx", float "ry", float "darkstr", float "brightstr", float "lowsens", float "highsens", float "ss")
{
# Now in MaskTools2 flavour!
rx = default( rx, 2.0 )
ry = default( ry, 2.0 )
darkstr = default( darkstr, 1.0 )
brightstr = default( brightstr, 1.0 )
lowsens = default( lowsens, 50 )
highsens = default( highsens, 50 )
ss = default( ss, 1.5 )
LOS = string(lowsens)
HIS = string(highsens/100.0)
DRK = string(darkstr)
BRT = string(brightstr)
ox = clp.width()
oy = clp.height()
uv = 1
uv2 = (uv==3) ? 3 : 2
halos = clp.bicubicresize(m4(ox/rx),m4(oy/ry)).bicubicresize(ox,oy,1,0)
are = mt_lutxy(clp.mt_expand(U=uv,V=uv),clp.mt_inpand(U=uv,V=uv),"x y -","x y -","x y -",U=uv,V=uv)
ugly = mt_lutxy(halos.mt_expand(U=uv,V=uv),halos.mt_inpand(U=uv,V=uv),"x y -","x y -","x y -",U=uv,V=uv)
so = mt_lutxy( ugly, are, "y x - y 0.001 + / 255 * "+LOS+" - y 256 + 512 / "+HIS+" + *" )
lets = mt_merge(halos,clp,so,U=uv,V=uv)
remove = (ss==1.0) ? clp.repair(lets,1,0)
\ : clp.lanczosresize(m4(ox*ss),m4(oy*ss))
\ .mt_logic(lets.mt_expand(U=uv,V=uv).bicubicresize(m4(ox*ss),m4(oy*ss)),"min",U=uv2,V=uv2)
\ .mt_logic(lets.mt_inpand(U=uv,V=uv).bicubicresize(m4(ox*ss),m4(oy*ss)),"max",U=uv2,V=uv2)
\ .lanczosresize(ox,oy)
them = mt_lutxy(clp,remove,"x y < x x y - "+DRK+" * - x x y - "+BRT+" * - ?",U=2,V=2)
return( them )
}
function m4(float x) {return(x<16?16:int(round(x/4.0)*4))}
Edit: Seems to work for me, even without MaskTools.dll. So yeah, success?
xekon
18th October 2011, 05:27
Yes, Thank you for the update, working great here!
gyth
18th October 2011, 15:33
FastLineDarken() is behaving strangely for me, so I left that out, I wonder if somebody has an alternative for it or a revised version.
http://forum.doom9.org/showthread.php?p=1060081#post1060081
it doubles the size and then halves it toward the end... does this make the filters work more efficiently or something?
Supersampling, probably to reduce aliasing.
I can only assume that the AddBorders(4, 0, 4, 0) was only so that deblock had a mod 8 source.... DeBlock_QED() seems to work without worrying about that.
Maybe to give warpsharp something to pull in at the edges?
mzso
8th October 2016, 20:20
Deblock()
dfttest()
FastLineDarken()
deen("a3d",4,8,9)
Spline36Resize(last.width*2,last.height*2)
AddBorders(4, 0, 4, 0)
aWarpSharp(depth=12,blurlevel=4,thresh=0.2,cm=1)
FastLineDarken()
aWarpSharp(depth=6,blurlevel=4,thresh=0.7,cm=1)
Crop(4,0,-4,0)
FastLineDarken()
DeHalo_Alpha()
fft3dgpu(bt=3,sigma=8,sharpen=1.3)
Spline36Resize(last.width/2,last.height/2)
Hi!
Can anyone tell me which is the least painful way to get this working? Is there a a pack which includes all the filters?
Or, alternatively does anyone know of an alternative? Something else with the same goals? Be it for avisynth or not.
StainlessS
8th October 2016, 21:30
You should find these
Deblock
dfttest
FastLineDarken
deen
aWarpSharp
DeHalo_Alpha
fft3dgpu # From FFT3DFilter
here:- http://avisynth.nl/index.php/External_filters
FFT3dFilter requires same dll as dfttest, in system32 or SysWow64(64bit OS, 32Bit AVS) but named differently
FFT3D requires named as fftw3.dll and dfttest as libfftw3f-3.dll (one of them at least should include it).
EDIT: The rest are built-in.
mzso
8th October 2016, 22:14
You should find these
Deblock
dfttest
FastLineDarken
deen
aWarpSharp
DeHalo_Alpha
fft3dgpu # From FFT3DFilter
here:- http://avisynth.nl/index.php/External_filters
FFT3dFilter requires same dll as dfttest, in system32 or SysWow64(64bit OS, 32Bit AVS) but named differently
FFT3D requires named as fftw3.dll and dfttest as libfftw3f-3.dll (one of them at least should include it).
EDIT: The rest are built-in.
Thanks. Do I need to use 64 bit avisynth for a 64 bit player? Does it make sense to use the MT variant?
StainlessS
8th October 2016, 22:22
Do I need to use 64 bit avisynth for a 64 bit player?
No idea (expect so), but probably optimistic to expect the required plugins to all have 64 bit versions.
EDIT:
MT variant?
Again, no idea.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.