Log in

View Full Version : Creating an avs file?


unimatrixzer0
11th February 2005, 23:45
Its been to the date a year and some odd days since I last used an avs file to encode video using divx. At the time my computer was just to slow to convert all the shows I was recording in a timely manner so I just went to capturing directly to mpeg to burn to dvd. I'd like to try divx again since I've upgrade since then, but I've forgotten the little I managed to learn a year ago. Just looking at some segments of scripts some of you have posted, its like reading a computer program source code or something.

loadplugin("d:\x\tomsmocomp.dll")
loadplugin("d:\x\mvtools0991.dll")

function tmcbob(clip i, int se) #50fps-bobbing
{
e=i.tomsmocomp(-1,se,0)
o=i.doubleweave().selectodd().tomsmocomp(-1,se,0)
interleave(e,o)
}


function reYV12(clip i) #reverting PAL-DV to YUV 4:2:0 using simple line selection
{
yx=i.converttoyv12().greyscale()
x=i.separatefields().separatefields().selectevery(4,0,2).weave()
ux=x.utoy().converttoyv12()
vx=x.vtoy().converttoyv12()
ytouv(ux,vx,yx)
}


function manaodenoise(clip source) #denoising
{
function efficace(clip c, bool backward, int del)
{
v = c.mvanalyse(isb = backward, lambda = 1000, blksize = 16, delta = del, idx = 1, pel = 2)
d = c.mvcompensate(v, mode = 1, thscd1 = 2500, thscd2 = 170).deblock(quant = 30)
return v.mvchangecompensate(d)
}

bw3 = source.efficace(false, 3)
bw2 = source.efficace(false, 2)
bw1 = source.efficace(false, 1)
fw1 = source.efficace(true, 1)
fw2 = source.efficace(true, 2)
fw3 = source.efficace(true, 3)

source.mvdenoise(bw3, bw2, bw1, fw1, fw2, fw3, thsad = 2500, thmv = 200, tht = 30, thscd1 = 2500, thscd2 = 170)
}


input=avisource("badnoise.avi").assumebff()

input.reYV12().tmcbob(5).manaodenoise()

output=converttoyuy2().assumebff().separatefields().selectevery(4,0,3).weave()

return output

Just looking at that, its like looking at a foreign language.

I found an old avs I use to use which sucked and very slow to beginning with but was much simplier looking.

LoadPlugin("D:\My Docs\LoadPluginEx.dll")
LoadPlugin("D:\My Docs\DustV5.dll")
LoadPlugin("D:\My Docs\Convolution3D.dll")

AVISource("C:\clip.avi",pixel_type="yuy2")
converttoyv12(interlaced=true)

Trim(1172,15657)+Trim(17007,31260)+Trim(32734,44096)

Telecide(order=1,guide=1,post=2,vthresh=68,chroma=false,blend=false,back=1,nt=20,hints=true)
Decimate(mode=2,quality=2)

converttoyuy2()
Convolution3d(preset = "movieLQ")
GoldDust(2)
UnDot()

crop(12,4,-6,-4)

LanczosResize(640,480)

I've included a sample clip off the station I'm recording off of. Ok, yes, its Power Rangers. lol, laugh all you want, I've liked this show since I was little. Maybe if someone has time they could tinker with it, maybe come up with a rough avs script for it. Its recorded off of a US tv station. The source will be an mpeg file which I would like to use divx with to convert to an avi.

Here is a sample off the station.

http://s21.yousendit.com/d.aspx?id=1TD8NQAG4BHJV19UV3F3NAHAGY

Any help you can give would be great :)

unimatrixzer0
13th February 2005, 04:09
*sigh* 10 hours wasted.

Tried so many combinations of settings with decomb and couldn't even remove all the interlacing/combing in that clip above.

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")

MPEG2Source("samp.d2v",cpu=4,iPP=true)

Telecide(order=1,post=2,chroma=false,blend=false,hints=true)
Decimate(cycle=5,mode=2,quality=3)

Guest
13th February 2005, 05:31
It wasn't wasted. It was a learning experience. The key is to set vthresh low enough. Here is what I did (in 5 minutes, but I have some inside information about this DLL):

loadplugin("dgdecode.dll")
loadplugin("decomb.dll")
MPEG2Source("movie.d2v",cpu=0)
telecide(order=1,post=2,vthresh=35,guide=1)
decimate(5)

It looks just dandy to me.

Of course, I used DGMPGDec 1.2.0 RC4 with field operation NONE, because it is hard telecined.

Some more advice: You won't be able to have one script for everything. Not all shows are telecined, for example.

unimatrixzer0
13th February 2005, 06:39
Yeah, I tried lowering the vthresh value. I tried setting it low to get rid of all the combing in that clip for instance, but then that starts to produce artifacts. Theres no middle, either its to high to get rid of all the combing or to low and starts to product artifacts.

Maybe another way of doing this? Decomb.dll is the only filter I've ever known about so I'm not familiar with other methods.

Guest
13th February 2005, 06:42
What artifacts are you talking about?

You can try tritical's stuff. Or SmartDecimate. But be aware that field matching cannot be perfect. That is why there is a postprocessor in Decomb.

Another option is to turn off the postprocessor and use, for example, KernelDeint() or TomsMoComp() for postprocessing.

unimatrixzer0
13th February 2005, 06:50
The boarder on the blue sign that says SPD.
http://up2.fastuploads.com/guy0.png

Guy in white in the background is still combed.
http://up2.fastuploads.com/guy2.png

Dots around the outline of the badge.
http://up2.fastuploads.com/badge00.png

Guest
13th February 2005, 06:52
With all due respect, you're being overly picky. Neither of those is perceptible when played at normal speed.

If you want to be that picky, you can use the override capability to make it perfect.

By all means try the alternatives. I'll be interested in your findings.

unimatrixzer0
13th February 2005, 06:58
Heh, I appologize. I guess I am being picky. I thank you for the suggestions you've provided. I'll try them and hope for the best.

Guest
13th February 2005, 07:00
Hey, no need to apologize! I'm a seeker after truth. I'd like it to be perfect too, believe me. That's why I'll be following this thread to see what you find.

Ciao, baby!

unimatrixzer0
13th February 2005, 19:19
Hmm, a bit confused. According to the Reference Manual for Decomb the only purpose of the show parameter for telecide is to display metrics on the frame. But having it set to true will actually remove some combing, but once I remove show or just set it to false to remove the metrics, some combing returns. Is it suppose to do that?

Still using the same clip from above.

The be exact after the Police badge the guy in white in the background who's coming out from the trees, with show=true you can visually see combing on him twice, but with show=false its more than twice. And then right before there is a scene change to the other people crawling in the mud there is combing there as well with show=false, but its gone with show=true.

I know its picky, but I thought I would point out how show=true/false is affecting the video since from my understanding it shouldn't be.

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Decomb521.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\kerneldeint140.dll")

MPEG2Source("samp.d2v",cpu=4,iPP=true)


Telecide(order=1,guide=1,chroma=false,vthresh=44,gthresh=5,post=1,hints=true,show=true)
KernelDeint(order=1,threshold=5,sharp=true)
decimate(cycle=5,mode=2,quality=3)

Leak
13th February 2005, 19:44
Originally posted by unimatrixzer0
Hmm, a bit confused. According to the Reference Manual for Decomb the only purpose of the show parameter for telecide is to display metrics on the frame. But having it set to true will actually remove some combing, but once I remove show or just set it to false to remove the metrics, some combing returns. Is it suppose to do that?

This probably is Decimate dropping different frames because the text produced by Telecide's "show=true" is getting analyzed by it as well...

np: Aesop Rock - The Greatest Pac-Man Victory In History (Bazooka Tooth (Headphone Science Version))

Guest
13th February 2005, 20:44
Leak is correct. Temporarily remove Decimate() when you apply show=true.