PDA

View Full Version : help checking my first script


Kumo
16th February 2008, 15:12
i'm trying to convert a japanese ntsc r2 anime dvd.this is my first encoding,my final script at the moment is
DGDecode_mpeg2source("E:\kor\VTS_01.d2v",info=3)
ColorMatrix(hints=true)
o = last
ox = o.width()
oy = o.height()

crop_L = 4
area_L = 32

crop_T = 4
area_T = 32

crop_R = 4
area_R = 32

crop_B = 0
area_B = 0

stackvertical(
\ stackhorizontal(
\ o.spline16resize(area_L,area_T,crop_L, crop_T,area_L-crop_L,area_T-crop_T),
\ o.spline16resize(ox-area_L-area_R,area_T, area_L,crop_T,ox-area_L-area_R,area_T-crop_T),
\ o.spline16resize(area_R,area_T,ox-area_R,crop_T,area_R-crop_R,area_T-crop_T) ),
\ stackhorizontal(
\ o.spline16resize(area_L,oy-area_T-area_B, crop_L,area_T,area_L-crop_L,oy-area_T-area_B),
\ o.crop(area_L,area_T,-area_R,-area_B),
\ o.spline16resize(area_R,oy-area_T-area_B, ox-area_R,area_T,area_R-crop_R,oy-area_T-area_B) ) )

source = last
backward_vec3 = source.MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = source.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = source.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = source.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = source.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = source.MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
source.MVDegrain3(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)

dfttest(sigma= 0.8)

LimitedSharpenFaster(ss_x=1.1, ss_y=1.1, smode=4, strength=150,undershoot= 10)

Tweak(sat=[<"mag", 0.50, 1.50, 0.95>],startHue=21,endHue=80,maxSat=150,minSat=0,interp=0) #magenta
Tweak(sat=[<"red", 0.50, 1.50, 1.05>],startHue=81,endHue=140,maxSat=90,minSat=0,interp=0) #red
#Tweak(sat=[<"yel", 0.50, 1.50, 1.0>],startHue=141,endHue=200,maxSat=150,minSat=0,interp=0) #yellow
Tweak(sat=[<"gre", 0.50, 1.50, 1.17>],startHue=201,endHue=260,maxSat=90,minSat=0,interp=0) #green
Tweak(sat=[<"cya", 0.50, 1.50, 1.19>],startHue=261,endHue=320,maxSat=90,minSat=0,interp=0) #cyan
Tweak(sat=[<"blu", 0.50, 1.50, 1.15>],startHue=321,endHue=20,maxSat=90,minSat=0,interp=0) #blue

dup()
i'd like to know if all filters are in corret order and if anyone has suggestions on it.thanks

Didée
16th February 2008, 15:33
Oh no. The "resize only borders" trick makes only sense if you're going to encode without any denoising filters. The goal of the method is to leave (most) pixels untouched.

Since you're using quite strong filtering (MVDegrain+dfttest) in the processing chain, you are doing substantial pixel changes anyway, so you can as well use the normal crop+resize method.

Kumo
16th February 2008, 16:44
isn't the resizing filter going to affetc the resulting video?i read that resizers introduce a lot of defects and noise,so better to avoid them.my reason for that kind of solution was to avoid useless filter,applying resize to borders only is better than applying to whole frame.am i wrong?what about others filters?is tweaking better at the beginning (working on untouched frames)or at the end(working on filtered)?

Sagekilla
16th February 2008, 19:35
Where did you read that resizing introduces "a lot of defects and noise"? If you have a noisy source to begin with and resize straight, yes you will have noise in the end result because it was there to begin with. If you're resizing then denoising, then there's no problem because you're removing the noise which resizing will barely affect to begin with.

In any case, I've never ran into an instance where resizing before, or after, denoising gave me any sort of trouble, regardless of the type of video (anime, real life, etc)

Kumo
16th February 2008, 20:16
i'm trying some samples.whre in my script it's suppose to better putting a resizer?

foxyshadis
16th February 2008, 23:35
Right where you have the whole crop/resize mess now is as good as anywhere. Or you can include it as dest_x and dest_y in LSF.

Adub
17th February 2008, 00:11
Edit: My bad.

Sagekilla
17th February 2008, 00:33
The motion estimation isn't for dfttest -- He's using it to call MVDegrain3.

Adub
17th February 2008, 01:33
Oops, my mistake. Sorry.

Kumo
17th February 2008, 10:12
Right where you have the whole crop/resize mess now is as good as anywhere. Or you can include it as dest_x and dest_y in LSF.

what kind of resizer will LSF apply?during its process,does it resize the frame anyway to apply sharpening?i'm asking to understand if calling in the script a different resizer would be a useless more filter.in case it wasn't,wich resizer do you suggest?thanks

Adub
17th February 2008, 10:27
To answer your question, resize as little as possible. Basically, only do it where necessary.

If you can resize with just LimitedSharpenFaster, do it. I believe that it uses Spline36resize, in case you were wondering.

Kumo
17th February 2008, 10:36
in my LSF script i see lanczosresize as resizer,would be using spline36 better?if yes,should i call it after LSF,avoiding to call its own resizer?

Sagekilla
17th February 2008, 17:48
Yes, any of the Spline (except Spline64) resizers are better than the Lanczos series. They produce less haloing and are generally more compressible (Even with small resizes) than Lanczos. Just open up your LSF.avs with notepad, hit Ctrl+H and type in "Lanczos4Resize" and replace it with "Spline36Resize" I don't remember if it's Lanc4 that's used though, you'll have to check. In either case, you can use the one built into LSF or just do a separate call.

Kumo
18th February 2008, 19:51
in limitedsharpenfaster i found lanczosresize,i changed it with spline36resize.i finally came to this DGDecode_mpeg2source("E:\kor\VTS_01.d2v",info=3)
ColorMatrix(hints=true)
crop(4,4,-4,-0)

source = last
backward_vec3 = source.MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = source.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = source.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = source.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = source.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = source.MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
source.MVDegrain3(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)

dfttest(sigma= 0.8)

LimitedSharpenFaster(ss_x=1.1, ss_y=1.1, smode=4, strength=200,undershoot= 10,dest_x=720,dest_y=480)

fastlinedarkenmod(thinning=0,strength=35)

Tweak(sat=1.1,startHue=80,endHue=140,interp=0) #red
Tweak(sat=1.2,starthue=141,endhue=79,interp=0)

dup()
anything wrong?any suggestion?thanks

Adub
18th February 2008, 20:45
It's interesting that your version of LSF has Lanczos, while the one on the wiki has Spline. Ah, well, no matter now.


But, to answer your question, your script looks a lot better. That crop value throws me off a little, but as long as avisynth nor your compressor throws an error, then rock on.

Kumo
18th February 2008, 22:18
do all the filters i'm using work fine on non-mod16 res? should i move crop after any filter?

Adub
18th February 2008, 22:51
Well, if you try running the script, and no errors occur, then everything should be okay. Although, it's always better to use mod-16 in my opinion, but if nothing chokes, then you're fine.

Terranigma
18th February 2008, 23:32
It's interesting that your version of LSF has Lanczos, while the one on the wiki has Spline. Ah, well, no matter now.

That' because originally, Limitedsharpenfaster had Lanczosresize there; there wasn't any spline resizers back then when Didee scripted it. I think blackmanresize would be a better choice though.

Kumo
19th February 2008, 10:18
i changed it again, allmost definetive :)
DGDecode_mpeg2source("D:\dario\VTS_01rc2.d2v",info=3)
ColorMatrix(hints=true)

source = last
backward_vec3 = source.MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = source.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = source.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = source.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = source.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = source.MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
source.MVDegrain3(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)

dfttest(sigma= 0.8)

crop(4,4,-4,-0)
LimitedSharpenFaster(ss_x=1.1, ss_y=1.1, smode=4, strength=200,undershoot= 10,dest_x=720,dest_y=480)

fastlinedarkenmod()

ColorYUV(levels="tv->pc")

dup()
i moved crop after mvdegrain. i read mvdegrainhas a default blocksize=8,after cropping my res was non-mod8.is it ok?has limitedsharpen any problem working on non-mod8?where would be the right place for coloryuv?
p.s.:sorry for bothering but i'm really trying to learn to encode well.