| Avisynth is a way to manipulate video with its own scripting language. It can do non-linear operation impossible in any other application and it is also generally very fast. Remember that (almost) nothing is impossible in avisynth. The homepage of avisynth has a great list of additional filters and some really good scripting examples. Also note that if you've got a PAL anime dvd you're most likely screwed since no filter can undo the blending that exists in most. If you used yatta in the previous steps you will now have an avs file which looks something like this which most people will find somewhat confusing. |
|
Note#1: Reading the avisynth tutorial found on avisynth.org is required since this text will mostly explain what yatta does. Note#2: Avisynth 2.5 can't load 2.0 plugins by default but loadpluginex.dll allows it to be done. The same colorspace restrictions do however still apply and those loadplugin lines have to be placed after the loadpluginex.dll one. You still use loadplugin() to load plugins and not loadpluginex(). Warning: Do not continue reading if you don't know what inverse telecine is or haven't figured out the basics of avisynth. Consult the decomb manual if you don't know what it is. The entire guide also more or less assumes you're dealing with a telecined dvd. |
| The basic AVS |
LoadPlugin("C:\DVDRIP\Filter\Decomb521.dll")
LoadPlugin("C:\DVDRIP\Filter\mpeg2dec3.dll")
mpeg2source("C:\DVDRIP\VOBS\video.d2v")
Telecide(order=1)
Decimate(cycle=5,quality=3)
Crop(8,0,-8,-0)
BilinearsResize(640,480)
|
| This is more or less the basic script everything is derived from which is why it's shown here. The first two lines load the required plugins to use telecide/decimate and mpeg2source. Mpeg2source loads the actual video (avisource also exists) and the telecide+decimate combination is then used to perform inverse telecine (or field matching as some call it). Crop removes the black bars on the sides and finally bilinearresize changes it to the new resolution. Many other groups more or less leave the avisynth activities here and go straight to encoding which is a bad idea if you've got a noisy source. |
| The full AVS |
LoadPlugin("C:\encoding\yatta\undot.dll")
...
LoadPlugin("C:\encoding\yatta\convolution3d.dll")
function Preset0(clip c) {
#Name: Default
c
return last
}
function Preset11(clip c) {
#Name: LoveHinaPostDecimate
c
undot()
converttoyuy2()
pixiedust(limit=5)
Convolution3D(0, 6, 12, 6, 8, 2.8, 0)
crop(8,0,-8,0)
dup(show=false,copy=true,threshold=0.4)
return last
}
function Preset3(clip c) {
#Name: Shift2
c
mergechroma(crop(2,0,0,0).addborders(0,0,2,0))
return last
}
Mpeg2Source("C:\encoding\lh_proj\1.d2v")
Telecide(hints=false,order=1,post=2,blend=true,ovr="C:\encoding\lh_proj\1.d2v.tel.txt")
PresetClip0=Preset0()
PresetClip3=Preset3()
PresetClip0.Trim(0,52)++PresetClip3.Trim(53,132)++PresetClip0.Trim(133,2692)++PresetClip3.Trim(...
FreezeFrame(447,447,446)
...
FreezeFrame(38743,38927,38922)
DClip = Decimate(cycle=5,quality=3,ovr="C:\encoding\lh_proj\1.d2v.dec.txt").assumefps(last.framerate)
DClip.trim(0,11619)+trim(14525,14539)+DClip.trim(11632,18391)+trim(22990,22999)+DClip.trim(...
Preset11()
Lanczos4Resize(640,480)
|
|
This is where it begins to get interesting since no human would possibly be able to write a script like this without errors. First comes the normal plugin loading and the only thing to observe here is that loadpluginex has to be before dustv5 but that's taken care of automatically. After that comes several function declarations where the first (Preset0) that does nothing. Preset11 is the only interesting function since that's where just about all filters are and Preset3 just shifts the chroma a few pixels. The interesting part comes after mpeg2source and telecide where the PresetN functions are applied to the source video and then cut into small pieces and reassembled to allow different filters on different sections. In this case it's a choice between no filtering (preset0) and shifting the chroma (preset3). After this comes a long list of freezeframes assigned in yatta, see the avisynth manual for an exact list. Next in the long script are the lines with DClip which are used to once again cut it all into small pieces to only apply the decimate filter on certain frames. This won't be preset unless you're using variable framerate in your encode. Then the function preset11 is used, the only reason actual filtering is in a function is to make the script easier to generate and everything inside the function could have been placed there. Finally there's the resizing (lanczos4 is much sharper than bilinear). |
Here are some scripts that have actually been used. The names say it all.
|
| -Proceed to the Divx 5.2.X settings. |