View Full Version : Creating an AviSynth Video Enhancement Script
Selur
1st October 2023, 13:24
YAHR3: https://pastebin.com/LUErwWR8
iirc. ex_unsharp is a script from Dogway
gispos
1st October 2023, 13:29
real.finder YAHRmods
https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.5%20and%20up/YAHRmod.avsi
Dogway's ex_unsharp
https://github.com/Dogway/Avisynth-Scripts/blob/master/MIX%20mods/SharpenersPack.avsi
gispos
1st October 2023, 14:11
I just don't know where there is a SmootUV 64bit dll. I can only find a SmoothUV2 from Asd-g.
real.finder's Zs_RF_Shared.avsi requires the old SmoothUV version. No idea if the new version is compatible.
kedautinh12
1st October 2023, 14:27
I just don't know where there is a SmootUV 64bit dll. I can only find a SmoothUV2 from Asd-g.
real.finder's Zs_RF_Shared.avsi requires the old SmoothUV version. No idea if the new version is compatible.
Download ver 2.1.1, you can use beside latest smoothuv ver (change name SmoothUV2.dll to SmoothUV.dll from 2.1.1 cause avoid same name with SmoothUV2.dll from latest ver) cause ver 2.1.1 have name of function is only smoothuv()
https://github.com/Asd-g/AviSynth-SmoothUV2/releases/tag/2.1.1
EHarlen
2nd October 2023, 11:41
I think we need to denoise before sharpening so I think this script is better for original1:
converttoyuv420
tfm(cthresh=10) # deinterlaced before upscale
lanczos4resize(1024,768)
TemporalDegrain2(postFFT=4, ppSCD1=1, thSCD2=20, fftThreads=2) # denoised
ex_unsharp(0.3,Fc=width()/1.5,safe=true) # Remove some of the dreamy look
ex_unsharp(1.0,Fc=width()*2.0,safe=true) # Extra fine sharpness
Video: https://drive.google.com/file/d/1c3t4IRnCBe_ZVsnTWronbAVBknnZBskZ/view?usp=drive_link
With original2, I think we can use this script for a good result:
converttoyuv420
tfm(cthresh=10) # deinterlaced before upscale
lanczos4resize(1024,768)
YAHR3() # dehaloing
TemporalDegrain2(postFFT=4, fftThreads=2) # denoised
ex_unsharp(0.3,Fc=width()/1.5,safe=true) # Remove some of the dreamy look
ex_unsharp(1.0,Fc=width()*2.0,safe=true) # Extra fine sharpness
Video: https://drive.google.com/file/d/19v88z3Q5wHUm-BQKU_3dirDDvhwx-twy/view?usp=sharing
What editor/encoder and codec did you use for encoding?
kedautinh12
2nd October 2023, 11:53
Megui with ffms2, x264, qaac, mkvmerge(mkvtoolnix)
EHarlen
2nd October 2023, 12:33
I don't know much about Megui.
Why do you use Megui with ffms2, x264, qaac, mkvmerge(mkvtoolnix)?
Can you post a YouTube video tutorial that explains this well?
EHarlen
2nd October 2023, 12:46
YAHR3: https://pastebin.com/LUErwWR8
iirc. ex_unsharp is a script from Dogway
real.finder YAHRmods
https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.5%20and%20up/YAHRmod.avsi
Dogway's ex_unsharp
https://github.com/Dogway/Avisynth-Scripts/blob/master/MIX%20mods/SharpenersPack.avsi
Thanks.
I'm using DeHaloHmod for FastLineDarkenMOD3_dhh but I'm getting the following error.
https://i.ibb.co/RBRPFBx/G3.png (https://ibb.co/KLT7PLM)
EHarlen
2nd October 2023, 12:53
With original2, I think we can use this script for a good result:
converttoyuv420
tfm(cthresh=10) # deinterlaced before upscale
lanczos4resize(1024,768)
YAHR3() # dehaloing
TemporalDegrain2(postFFT=4, fftThreads=2) # denoised
ex_unsharp(0.3,Fc=width()/1.5,safe=true) # Remove some of the dreamy look
ex_unsharp(1.0,Fc=width()*2.0,safe=true) # Extra fine sharpness
Video: https://drive.google.com/file/d/19v88z3Q5wHUm-BQKU_3dirDDvhwx-twy/view?usp=sharing
Can you post all the filters you used for this script?
kedautinh12
2nd October 2023, 13:08
I don't know much about Megui.
Why do you use Megui with ffms2, x264, qaac, mkvmerge(mkvtoolnix)?
Can you post a YouTube video tutorial that explains this well?
Cause Megui easy to use and other decode and compress video/audio very good
kedautinh12
2nd October 2023, 13:10
Can you post all the filters you used for this script?
Do you using x86 or x64 avisynth+??
kedautinh12
2nd October 2023, 13:12
Can you post all the filters you used for this script?
You need download all scripts from real.finder and Dogways to work very well (check update for your scripts with them too)
https://github.com/realfinder/AVS-Stuff/tree/Community
https://github.com/Dogway/Avisynth-Scripts
EHarlen
2nd October 2023, 13:25
Do you using x86 or x64 avisynth+??
I'm using x86 avisynth+
ingoldie
4th October 2023, 12:48
I think we need to denoise before sharpening so I think this script is better for original1:
converttoyuv420
tfm(cthresh=10) # deinterlaced before upscale
lanczos4resize(1024,768)
TemporalDegrain2(postFFT=4, ppSCD1=1, thSCD2=20, fftThreads=2) # denoised
ex_unsharp(0.3,Fc=width()/1.5,safe=true) # Remove some of the dreamy look
ex_unsharp(1.0,Fc=width()*2.0,safe=true) # Extra fine sharpness
Video: https://drive.google.com/file/d/1c3t4IRnCBe_ZVsnTWronbAVBknnZBskZ/view?usp=drive_link
With original2, I think we can use this script for a good result:
converttoyuv420
tfm(cthresh=10) # deinterlaced before upscale
lanczos4resize(1024,768)
YAHR3() # dehaloing
TemporalDegrain2(postFFT=4, fftThreads=2) # denoised
ex_unsharp(0.3,Fc=width()/1.5,safe=true) # Remove some of the dreamy look
ex_unsharp(1.0,Fc=width()*2.0,safe=true) # Extra fine sharpness
Video: https://drive.google.com/file/d/19v88z3Q5wHUm-BQKU_3dirDDvhwx-twy/view?usp=sharing
There is still a loss of detail. It looks very smooth and unnatural. It doesn't seem realistic. Also dehaloing is very bad.
kedautinh12
4th October 2023, 13:13
Yeah, i can't make a magic to add more details lost when your original source was lost details too. I compared with my encoded and your original source frame by frame with 400% zoom in AVSPmod
kedautinh12
4th October 2023, 13:21
And if you want realistic from your video after denoiser, you need add clean grain back with this script
FilmGrainPlus(preset="Vision2 5218 500T")
Btw, you don't requested very high when your source video lost very much details. Hope someone can do very well with your high requested :D
ingoldie
12th October 2023, 13:36
Enhancement results of some Fiverr sellers
https://www.mediafire.com/file/vsevepoz51ar8db/Enhancement_results.rar/file
Softwares used according to what they say: Topaz, AVCLaps, HitPaw
As you can see it all looks very unnatural.
Is it that difficult to get a natural result?
I want to create an Avisynth script that will give natural results, but I cannot get enough help.
kedautinh12
12th October 2023, 16:08
Your life will better when you reduce high requested when your video source lost very much details but you blame denoiser (i compared frame by frame). If you want your source video take back details, you can try some software to draw details were losted (maybe) :D
ingoldie
12th October 2023, 16:53
If the problem is with my source video, can you show me an Avisynth script that can produce the result I want to achieve and the result video of this script?
For example an Avisynth script that can produce the following result
https://www.youtube.com/watch?v=D7-_kK35cIA
kedautinh12
12th October 2023, 17:06
Use stackhorizontal to compare video before and after used script:
https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/stack.html
ingoldie
12th October 2023, 17:12
I mean an Avisynth script that will give result(video on the right).
By the way, if the problem is with my source video use another one.
kedautinh12
12th October 2023, 17:55
Your 2 source video lost deatails too
StainlessS
12th October 2023, 19:12
Ingoldie link is/was using Mirtemis HawkView.
Google, "Mirtemis HawkView"
https://www.google.co.uk/search?q=%22Mirtemis+hawkview%22&sca_esv=572931913&bshm=rimc%2F1
YouTube, Mirtemis HawkView,
https://www.youtube.com/results?search_query=Mirtemis+HawkView
EDIT: In 2nd [for me] google link, says "HawkView real-time super resolution hardware."
EDIT: simple upscale template
VideoFileName="Weeds (1987) VHSRip.mp4" # Or whatever filename
USCALE = 4 # Int, 2,4,8
STACK = True
#STACK = False
###
LSMashVideoSource(VideoFileName) # Or Whatever source filter
ORG=Last
###
W = ORG.Width *USCALE H = ORG.Height*USCALE
ORG_B = ORG.PointResize(W,H)
#############
# YOUR better "Super Resolution" Upscaler, upsized by USCALE
Spline64Resize(ORG,W,H)
#############
Return (STACK) ? StackHorizontal(ORG_B,Last) : Last
EDIT: From here [2010/02/15/special-72-israeli-companies-to-exhibit-in-the-mobile-world-congress]:- https://www.vccafe.com/2010/02/15/special-72-israeli-companies-to-exhibit-in-the-mobile-world-congress/
Mirtemis – Mirtemis develops real-time super-resolution image
processors for camera OEMs in consumer electronics, aerospace and defense sectors. Mirtemis Hawkview increases image resolution ways beyond the resolution limits of the imaging sensor, with no additional optics. This enables OEMs to offer up to X5 more zoom, sharper images, dramatically reduced noise and turbulence compensation, at the same level of bill-of-material cost
Mirtemis.com is now a dead site.
ingoldie
21st October 2023, 13:27
Can you provide an AviSynth script you prefer for upscaling + sharpening + denoising with a video sample?
ingoldie
22nd October 2023, 13:28
Have you ever used Neural Enhance Deep Learning?
https://github.com/alexjc/neural-enhance
https://www.youtube.com/watch?v=D2GwORMbOEo
Here is a sample
https://www.youtube.com/watch?v=gqo5Q4W0rNk
I couldn't understand how to use it but the output video doesn't look bad.
Also a sample about Digital Film Restoration from the same YouTube channel
https://www.youtube.com/watch?v=5TrLaDHu-M4
Here's the Avisynth+ scripts that used
https://drive.google.com/file/d/1Pkb9sjNQSdgoVIJRJfNUPgq7LXFqcop9/view
EHarlen
23rd October 2023, 13:40
Also a sample about Digital Film Restoration from the same YouTube channel
https://www.youtube.com/watch?v=5TrLaDHu-M4
Here's the Avisynth+ scripts that used
https://drive.google.com/file/d/1Pkb9sjNQSdgoVIJRJfNUPgq7LXFqcop9/view
A Version of "VideoFred" Film Restoration Script
Thanks for this.
ingoldie
6th November 2023, 14:37
A new video enhancement sample
Original sample
https://www.mediafire.com/file/yd3rh7uerjvhd1i/Original_sample.mp4/file
Result (enhanced sample)
https://www.mediafire.com/file/s56wxead6oy6zeb/Result_%2528enhanced_sample%2529.mp4/file
What do you think about the result?
johnmeyer
6th November 2023, 19:39
Looks pretty good. You sharpened the hair nicely.
The colors have changed a bit. I'm not sure you were trying to do that.
anton_foy
7th November 2023, 00:31
Some mlrt stuff or pure avisynth?
Edit: no script so no answer I guess.
ingoldie
20th November 2023, 13:04
And deformities relate interlaced not noised.
I'm so sorry. You were right. I realized the original (full) video was progressive.
But I exported it as interlaced to split it into the following sample parts.
Original(512x384)
https://mediafire.com/file/ldfiyrscrrv85gz/Original1.avi/file
Original2(512x384)
https://mediafire.com/file/24uvlc89yzx6atx/Original2.avi/file
But I guess both interlaced and bad denoising causes deformaties during noise reduction.
For example when I use DegrainDenoiseSharpen with the default values, it doesn't cause deformaties in the original (full) progressive video.
But when I increase the value of the denoising parameters(sigma,thSAD etc.), or use other denoisers, it causes deformaties in the original (full) progressive video.
To see DegrainDenoiseSharpen
https://forum.doom9.org/showthread.php?p=1991080#post1991080
ingoldie
20th November 2023, 17:01
By the way, the software used to get Result (enhanced sample) is not AviSynth
A new video enhancement sample
Original sample
https://www.mediafire.com/file/yd3rh7uerjvhd1i/Original_sample.mp4/file
Result (enhanced sample)
https://www.mediafire.com/file/s56wxead6oy6zeb/Result_%2528enhanced_sample%2529.mp4/file
Selur
20th November 2023, 19:34
By the way, the software used to get Result (enhanced sample) is not AviSynth
'Result (enhanced sample)' looks like you used SwinIR or GRLIR and turned up the saturation.
(personally, I don't like the look of it)
johnmeyer
20th November 2023, 23:38
'Result (enhanced sample)' looks like you used SwinIR or GRLIR and turned up the saturation.
(personally, I don't like the look of it)I made the same comment about the colors: I said they had changed, but if I had been more critical, I would have said they looked "wrong."
kedautinh12
21st November 2023, 02:59
Yeah, but with @ingoldie's mind, he call it's "realistic" and "natural" :D
ingoldie
21st November 2023, 13:15
'Result (enhanced sample)' looks like you used SwinIR or GRLIR
Not both.
Selur
21st November 2023, 18:21
Other GAN based models will probably do the same thing with hair&co, but it looks like machine learning based filtering.
ingoldie
22nd November 2023, 14:43
I'm so sorry. You were right. I realized the original (full) video was progressive.
But I exported it as interlaced to split it into the following sample parts
Here are the original parts of the full progressive video.
Sample
https://www.mediafire.com/file/4n4hfa32m3f2x5h/Sample.avi/file
Sample 2
https://www.mediafire.com/file/lj4ga7pja7vkqd4/Sample_2.avi/file
Sharc
22nd November 2023, 18:17
I made the same comment about the colors: I said they had changed, but if I had been more critical, I would have said they looked "wrong."
601 vs 709 colormatix issue?
ingoldie
27th November 2023, 15:08
BT.601 vs BT.709
https://blog.maxofs2d.net/post/148346073513/bt601-vs-bt709
coolgit
3rd December 2023, 02:22
A new video enhancement sample
Original sample
https://www.mediafire.com/file/yd3rh7uerjvhd1i/Original_sample.mp4/file
Result (enhanced sample)
https://www.mediafire.com/file/s56wxead6oy6zeb/Result_%2528enhanced_sample%2529.mp4/file
What do you think about the result?
ST Voyager dr surgery room is the worse tv viewing ever. How the directors allow the idiotic black and yellow background to be used for 7 season is outright bad tv. the 'jaggies' when object move pass those lines are so annoying.
ErazorTT
7th January 2024, 17:26
I was instructed to post results of TemportalDegrainV2 for the two videos in here. I just adjusted the 4 main parameters: grainLevel, degrainTR, postFFT, postSigma.
First video: 1.mov (https://drive.google.com/file/d/1wGLSyfn-BKTaBLSxudJ3CyfS8L6cWlzY/view?usp=drive_link)
Script:
LoadPlugin("ffms2.dll")
FFVideoSource("Result without denoising.avi", cachefile="index1.ffindex", threads=1, track=0)
ConvertToYUV444()
TemporalDegrain2(grainLevel=0,degrainTR=2,postFFT=3,postSigma=0.5,fftThreads=2)
Second video: 2.mov (https://drive.google.com/file/d/1kEt5rJg4Xbaynya2J61289vdxa13wd_k/view?usp=drive_link)
Script:
LoadPlugin("ffms2.dll")
FFVideoSource("Result without denoising 2.avi", cachefile="index2.ffindex", threads=1, track=0)
ConvertToYUV444()
TemporalDegrain2(grainLevel=2,degrainTR=5,postFFT=3,postSigma=0.75,fftThreads=2)
ingoldie
16th January 2024, 16:27
First video: 1.mov (https://drive.google.com/file/d/1wGLSyfn-BKTaBLSxudJ3CyfS8L6cWlzY/view?usp=drive_link)
Script:
LoadPlugin("ffms2.dll")
FFVideoSource("Result without denoising.avi", cachefile="index1.ffindex", threads=1, track=0)
ConvertToYUV444()
TemporalDegrain2(grainLevel=0,degrainTR=2,postFFT=3,postSigma=0.5,fftThreads=2)
Second video: 2.mov (https://drive.google.com/file/d/1kEt5rJg4Xbaynya2J61289vdxa13wd_k/view?usp=drive_link)
Script:
LoadPlugin("ffms2.dll")
FFVideoSource("Result without denoising 2.avi", cachefile="index2.ffindex", threads=1, track=0)
ConvertToYUV444()
TemporalDegrain2(grainLevel=2,degrainTR=5,postFFT=3,postSigma=0.75,fftThreads=2)
But I'm getting the following error when I use the scripts
https://i.ibb.co/DW5k1h2/1.png (https://imgbb.com/)
Avisynth filters I use
neo_DFTTest-r8, neo_FFT3D_r11, masktools2_v2.2.30, mvtools-2.7.45-with-depans20210608, RgTools-v1.2 and TemporalDegrain-v2.6.7
Avisynth and Script Editor
AviSynthPlus_3.7.3_20230715_vcredist and AvsPmod_v2.7.6.6_.Windows_x86-32
By the way I'm getting
https://i.ibb.co/tQGK5r7/2.jpg (https://imgbb.com/)
kedautinh12
16th January 2024, 16:50
You need change the name of plugins like this warning or this cause some problems
StainlessS
16th January 2024, 17:04
So,
neo-dfttest.dll ==> neo_dfttest.dll
neo-fft3d.dll ==> neo_fft3d.dll
Plugin file names (excluding the '.dll' part) should be of the same format as both variable names or function names, ie,
The 1st character can be "_" or Alphabetic, thereafter can also be digit.
ingoldie
16th January 2024, 17:09
Of course I changed the name of plugins but it didn't work.
I'm getting the same error.
https://i.ibb.co/DW5k1h2/1.png (https://imgbb.com/)
StainlessS
16th January 2024, 17:16
Suggest wait for Gispos to chime in.
gispos
18th January 2024, 18:00
Of course I changed the name of plugins but it didn't work.
I'm getting the same error.
https://i.ibb.co/DW5k1h2/1.png (https://imgbb.com/)
The incompatible name of the dll does not lead to a crash. The dll name is only important for a correct assignment of the functions and parameters for e.g. the sliders or the tooltips in the editor.
If AvsPmod crashes without showing an error message (only system error message), then there is usually a serious error. It is then usually a crash due to an access violation. So Avisynth or a dll crashes and takes AvsPmod with it into the abyss.
Are all Dll's really 32bit versions?
I have an archive here with which TemporalDegrain2 works for me. I didn't check whether they were current versions because I no longer use 32bit.
https://drive.google.com/drive/folders/1AvKyr_URbzXP8_heKry1SDoq9EfvgcD4?usp=drive_link
ingoldie
20th January 2024, 14:10
Thanks.
When I used neo_dfttest.dll and neo_fft3d.dll files in the folder gispos provided the problem was solved.
ingoldie
4th February 2024, 13:28
The problems with the code I wrote are not ending.
When I use AviSynthPlus-MT-r2772-with-vc_redist and AvsPmod_205 I'm getting "unexpected charecter "["" error with TemporalDegrain-v2.6.7
When I use AviSynthPlus_3.7.3_20230715_vcredist and AvsPmod_v2.7.6.2_.Windows_x86-32 I'm getting "invalid arguments to function 'Default'" error with a filter I use.
Can you please help?
StainlessS
4th February 2024, 14:19
AviSynthPlus-MT-r2772 does not support arrays ("[" character, I think).
AviSynthPlus_3.7.3 is the one you want.
"invalid arguments to function 'Default'" error with a filter I use.
Post the script function where Default() error occurs, and hi-lite the problem line.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.