Log in

View Full Version : Filter order in script


OneXaero
19th December 2009, 19:59
Hi all, I'm new to avisynth scripting. After trying every single way to avoid using avisynth scripts I finally had to give up. Now I am hooked to avisyth. :D

So my first script is ready and wanted to know two things:
I read that the order of filters in important. I tried google but couldn't find anything definitive so thought better to ask one of you guys. Script below:

DirectShowSource("D:\Capture001.mpg")
LanczosResize(384, 288)
Crop(8, 8, -8, -8)
Levels(0, 0.6, 255, 0, 255, coring=true)
ConvertToYV12(interlaced=false)
Convolution3d (preset="vhsBQ")

Secondly, I used the DirectShowSource() fn to open the source, many scripts I have seen use some other way to decode the stream. Is my script fine?

It's a video I captured from a VHS tape that was really bad so I am applying the convolution fileter and then encoding to x264 so I guess i need to keep it in the YV12 colourspace, right?

StainlessS
19th December 2009, 21:30
Hi OneXAero, seems we are both very Newbie.

Go to http://neuron2.net/
Click on MINE, Avisynth and look for DGMPGDec,
this is what you want for mpeg decoding, Also, read in manual
about creating Avsynth templates with DGMPGDec.

For getting rid of VHS color aborations, I sometimes use CNR2
(color noise reducer 2, I think). Give it a try.
As far as you script goes, I would use the cropping facility in
your chosen resizer rather than as an after thought. By the way,
you are using VirtualDubMod with Avisynth, are you not, if not,
you should. You can (in VirtualDubMod) go to Filters,Null Transform,
Cropping - to see what you should be using for crop.
Also, I personally use AVSEdit, not brilliant and somewhat
old, but I'm used to it. A filter I use extensively, is
FFT3DFilter(), usually last or just before a resize. Resize last
is probably best unless pushed for time and reducing in size
where 1st may be a gud idea. Also, Im sure levels is real gud
but cant remember the last time I used it except as a difference
amplifier when comparing nearly identical clips. I personally like
to use ColorYUV() and view histogram (YV12 Only) using
Histogram(mode="levels") [you can remove the conversion
to YV12 after viewing].
Cant say I do any x264 but YV12 sourds about right.

Sounds daft eh, editing video with a text script, works
wonderfully well though, contrary to expectations.

Happy synthing :)

OneXaero
28th December 2009, 08:11
Hey, thanks for the reply.
I have avsedit too 0.3 version or something it's old so I don't use it now. i wanted something new to got AvsP. Try it out it's nice and gives you a preview too.

I don't use virtual dub anymore. I plan to use MeGUI to compress the movie so I think it will either use ffmpeg or my dshow FFdshow-tryouts. Does DGMP help in this case? Does it have any advantages?

I plan to compress the video to x264 so it would be YV12 but I'm not sure where to add this conversion - at the end or beginning.

StainlessS
29th December 2009, 03:56
I've got AvsP, got to give it a try one day. (Just had a rummage, I had written that it 'looks good', so I must
have had at least, a quick look).
Never looked at MeGUI, downloading as I type.
I actually said 'VirtualDubMod', it's a modified version of VD that allows you to edit AVS script from
within Virtualdub, perhaps you feel you dont need it, having AvsP.
DGMPGDec is for decoding mpeg in side an AVS script, instead of DirectShowSource, allows for faster
scrolling etc as is pre-indexed, it is also better than DirectShowSource, you need this.
YV12 Conversion, well I guess to a certain extent it depends on the filters that you wanna use. Generally
speaking, converting to YV12 first will reduce processing time.

OneXaero
29th December 2009, 07:23
I've been using Virutual dub for 5yrs. I've tired virtualdubmod as well but I am doing x264+AAC in MKV so Virtualdubmod is not the best tool for it.
I will only use something if it gives better speed or quality during actual encoding. It is better than directshow source in anyway in that sense?
I have to convert to YV12 anyway before encoding because I am using x264 and megui prompts to convert it. So I will add it earlier.

I tried moving the convolution 3d filter aboved the resize and it gave lower filesize although the encoding time increased. I think it may be better for quality so will use it that way.