Log in

View Full Version : Help with AviSynth


Enigma0456
18th February 2018, 21:20
I'm working on the treatment of the cutscenes of the game (from PlayStation 1), Megaman 8. But as I know almost nothing about the handling of AviSynth I will need some advice on the plugins.

The video (https://drive.google.com/open?id=10z0sHs0OL7sCnPAoYQbOul4KS_52hsA8), as you can see, was been most likely compressed because of the limited space available on the CD-ROMs used for burning PS1 games.

Here is my AviSynth script (https://doc-10-8k-docs.googleusercontent.com/docs/securesc/vgv69maqh3o00m9deckvg39olbi1btf4/72uaf4l9blooh4io72lfcrunsbik7rtr/1518976800000/00563278502229951813/02472902634980814103/1q42LZG1J1mjMR88uXvoHOHZZ--DMxeet?e=download&nonce=6q892n3263v6u&user=02472902634980814103&hash=v1opf82h6ou03g041hfrnc8vcn72rhlu). I also added the Warp sharp filter from VirtualDub, this aspect having significantly improved the quality of the image (https://drive.google.com/open?id=1QlZZV-XyX9B68l-FZodD4wbYcSQDsc8K) automatically made the drawing lines a bit strange.

PS: For the purpose of curiosity I riped the cutscenes with the help of a program called jpsxdec (https://github.com/m35/jpsxdec).

ChaosKing
19th February 2018, 22:08
I get a http 403 error when clicking on your script...
Your drawing lines are strange because the warping effect is too strong, set it lower.

If you want to try out vapoursynth, here's a quick & dirty script than looks not that bad. An Avisynth version would look more or less the same. ( I don't have it installed right now)
Sample (https://www.dropbox.com/s/31na1w5m3upx92m/mega.mkv?dl=0)
import vapoursynth as vs
import mvsfunc as mvf
import havsfunc as haf
import nnedi3_rpow2 as nn
core = vs.get_core()

clip = core.lsmas.LWLibavSource(source=r"D:\Download\ROCK8.avi")
clip = mvf.Depth(clip, 16)

orig=clip
def mega(clip):
pre=clip.knlm.KNLMeansCL(d=4, a=8, h=4)
pre = haf.DeHalo_alpha(pre, rx=2,ry= 2)
return haf.SMDegrain(clip, tr=3, pel=2, contrasharp=True, thSAD = 550, thSADC = 450, blksize = 8, truemotion = False, RefineMotion=True, prefilter=pre)


clip = mega(clip)

clip = haf.DeHalo_alpha(clip, darkstr= .6, brightstr=.8,ss=2, rx=2.6,ry= 2.6)
clip = nn.nnedi3_rpow2(clip, nsize =4, qual =2, nns =4)
clip = core.warp.AWarpSharp2(clip, type = 1, blur=1, depth=4)
clip = clip.f3kdb.Deband(preset="medium", output_depth = 10).rgvs.RemoveGrain(mode=1)

crop = 0
clip = core.std.StackHorizontal([
core.std.CropRel(nn.nnedi3_rpow2(orig).fmtc.bitdepth(bits=10), crop,crop,0,0).text.Text("source"), \
core.std.CropRel(clip, crop,crop,0,0), \
])

clip.set_output()

Enigma0456
10th March 2018, 02:11
I get a http 403 error when clicking on your script...
Your drawing lines are strange because the warping effect is too strong, set it lower.

If you want to try out vapoursynth, here's a quick & dirty script than looks not that bad. An Avisynth version would look more or less the same. ( I don't have it installed right now)
Sample (https://www.dropbox.com/s/31na1w5m3upx92m/mega.mkv?dl=0)
import vapoursynth as vs
import mvsfunc as mvf
import havsfunc as haf
import nnedi3_rpow2 as nn
core = vs.get_core()

clip = core.lsmas.LWLibavSource(source=r"D:\Download\ROCK8.avi")
clip = mvf.Depth(clip, 16)

orig=clip
def mega(clip):
pre=clip.knlm.KNLMeansCL(d=4, a=8, h=4)
pre = haf.DeHalo_alpha(pre, rx=2,ry= 2)
return haf.SMDegrain(clip, tr=3, pel=2, contrasharp=True, thSAD = 550, thSADC = 450, blksize = 8, truemotion = False, RefineMotion=True, prefilter=pre)


clip = mega(clip)

clip = haf.DeHalo_alpha(clip, darkstr= .6, brightstr=.8,ss=2, rx=2.6,ry= 2.6)
clip = nn.nnedi3_rpow2(clip, nsize =4, qual =2, nns =4)
clip = core.warp.AWarpSharp2(clip, type = 1, blur=1, depth=4)
clip = clip.f3kdb.Deband(preset="medium", output_depth = 10).rgvs.RemoveGrain(mode=1)

crop = 0
clip = core.std.StackHorizontal([
core.std.CropRel(nn.nnedi3_rpow2(orig).fmtc.bitdepth(bits=10), crop,crop,0,0).text.Text("source"), \
core.std.CropRel(clip, crop,crop,0,0), \
])

clip.set_output()

I'm sorry for the link I sent you and also for leaving you waiting. Here is the correct link (http://https://drive.google.com/open?id=1q42LZG1J1mjMR88uXvoHOHZZ--DMxeet). You did a good job with image processing. Is it possible to make it even better? For example, would it be possible to increase the the video resolution without affecting quality?

LemMotlow
10th March 2018, 02:44
I'm sorry for the link I sent you and also for leaving you waiting. Here is the correct link (http://https://drive.google.com/open?id=1q42LZG1J1mjMR88uXvoHOHZZ--DMxeet).Nope. Error: "Server Not Found". Why don't you just paste your script in this thread?

would it be possible to increase the the video resolution without affecting quality?There is no way to increase the resolution. It is what it is. Do you mean sharpen it?

ChaosKing
10th March 2018, 10:06
My script doubles the resolution.

Enigma0456
10th March 2018, 15:26
Nope. Error: "Server Not Found". Why don't you just paste your script in this thread?

Not again!:( Here is the script (I hope it works this time):

AviSource("C:\Vid\ROCK8.AVI")
Crop(0,0,-0,-4)
BicubicResize(1280,720)
ConvertToYV12
unblock(cartoon=true)
HQDering(255, 255)
DeHalo_alpha(rx=2.0, ry=2.0, darkstr=0.4, brightstr=1.0, lowsens=50, highsens=50, ss=1.5)

As you can see, it is a very simple script. That's because I'm just a beginner.

There is no way to increase the resolution. It is what it is. Do you mean sharpen it?

I know that. I wanted to say is to place a HD resolution in the video.

ChaosKing
10th March 2018, 16:02
You will just waste hdd space with a HD resolution and it won't look better! You can't turn a crappy source into gold.

Enigma0456
11th March 2018, 17:12
You will just waste hdd space with a HD resolution and it won't look better! You can't turn a crappy source into gold.
I know that, it was just an example. So there's nothing left to do, right?