You are on page 1of 7

This guide will start what will be a 3 guide series to help encoders,leechers and practically everyone to max out

on their MT experience What we do on Minitheatre i.e Video Processing is a Three way process, 1.)Pre processing 2.)Processing aka Encoding 3.)Post processing aka Muxing etc In this Guide 1 we will discuss pre-processing and how to accomplish it.Why it is necesarry and why it should not be merged with Step 2 i.e Encoding PRE PROCESSING Pre processing involves getting the source in perfect condition beforehand.It doesn't involve Encoding it only involves using proper filters,cropping resizing(if any),trimming video if required etc and finally previewing it on Media Player Classic or any compatible player:) _____________________________________________ WHAT YOU REQUIRE TO START For a video pre processing u will need a specialised software for example AvsPmod and Latest Avi-Synth version,these Plugins and Media Player Classic with latest Codecs(CCCP or K-Lite) The plugins I linked should be moved to the default AviSynth folder in Windows.It contains all the 225 files I gathered for Avi synth plugins _________________________________________________________ WHAT ARE FILTERS? Filters are like make up that can be used to hide the deformities the source video has similarly overdoing it is gonna make the source turn real ugly so it needs you to spend time on it.Dont try to use same pre processing filters for all sources or u wouldn't even want to upload your encodes.Spend 15-30 minutes on any series you start with.Try different combinations of filters to figure out what looks better and what doesn't and once u are done line up your encodes on any avi Synth compatible encoding software ___________________________________________________ HOW TO MAKE A AVISYNTH SCRIPT To make an avisynth script 1.)Open a new notepad file/new tab in AvsPmod 2.)save it with a ".avs" extension for example "Episode1.avs" 3.)Now type something like this
LoadPlugin("C:\Program Files\AviSynth 2.5\ffms2.dll") FFVideoSource("C:\Users\abc\Desktop\MyEncode.mkv") ConvertToYV12()

4.)Save this and drag drop on your Mpc or click play with "External player" on AvsPmod. This is same as the normal source file without any filters.Now we will add some filters to it ___________________________________________________ ADDING FILTERS As u can see in the pages I linked with many of the filters that most filters require Dll files to be located in order to work.Incase u dont have them in the default AviSynth Plugin folder and have them elsewhere u have to do it manually everytime u load a filter For this we use "LoadPlugin" for eg.
LoadPlugin("C:\Users\abc\Desktop\masked_Tools.dll")

The script will tell u itself if u are a dll short

Another type of filters are Script functions.Script functions are the filters that require u to Import the script of the filter into your Script and only then can u use it. Eg- vmtoon,FastLineDarkener etc Here is how you use it-->

Import("C:\Users\abc\Desktop\vmtoon.avs") vmtoon()

Unless u dont import it vmtoon wont work same for any Script function that has avs extension,avsi script functions are auto loading and dont need to be manually added everytime u use them eg LSFmod ___________________________________________________ [OPTIONAL FILTERS] CROP As the name suggests this filter can be used to crop of the black edges off the encode that are usually left by unexperienced fansubs while encoding of DVDs and BDs.To use this
crop(0,0,-0,-0)

The first being cropping from Left,Second being from the top third from right and last from bottom.just keep using preview to confirm and make sure you dont crop the details ___________________________________________________ RESIZING FILTER Try to keep the resolution (1280,720) or (960,720)(depending on your aspect ratio ofc) at this point so add this line to ur script
spline64resize(1280,720)

Even 480p sources may be resized to 720p while doing filtering process.this is done since most filters are made to work for 720p so they look better on 720p.This being called Super Sampling.(1080p source dont need to be resized).this also needs to be done to compensate for any cropping done by you and achieve the required size. What not to use--> Lancoz Resize filter ___________________________________________________ [OPTIONAL FILTERS] TRIM Trim as the name suggests cuts the video from the frames you choose.In case you are not confident of your filters and wanna confirm how it will look like when encoded,trim can be a boon to you in the script add trim(starting frame,ending frame) Eg
trim(2000,4000)

incase u want samples from 2 different places in the video add something like this
trim(2000,4000)++trim(16000,18000)

Every 2000 frames approximate to like 1 minute of video footage so you should have a good a enough sample to check beforehand ^_^ ___________________________________________________ [OPTIONAL FILTERS] DEBANDING I dont think most of u know Banding is...Banding happens when video is compressed and similar colors get posterized. This undesirable, visible bands of color that can be distracting, and in some cases downright ugly.And this is not at all rare...infact almost every single source has it in some frames if not all. checked Morita San no Mukuchi from 5-6 fansubs all had the same issue somewhere or the other

so how to remove banding? Well we use the filter Gradfun2Db() mostly..


Gradfun2db()

Though with 10bit making its way into encoding....very soon no banding issues will arise ___________________________________________________ DENOISE FILTERS In case the source has noise aka grains its best to remove them before Smoothening or Sharpening.See this pic to see what grainy sources look like LINK For Denoise I generally use removegrain but seems there is removegrainHD too which is better besides that the x264 has inbuilt noise reduction filter which u can get by adding "--nr 500" to your command line For removegrainHD add the following

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

Another good Denoiser is FFT3DFilter,it is as strong is Deen in its compression too lol.Only drawback is its Slow >_< Try not to use Undot filter which is another Denoising filter ____________________________________________________ TWEAK FILTER Now u can use the "Tweak" filter in case ur source is too dark/too light or needs help with its brightness or contrast For eg in case it seems washed out atm add this line to your script
Tweak(cont=1.0,sat=1.10,bright=0,hue=0)

The above will make the source more Saturated with colours so faded out sources will look better.Similarly read more about tweak HERE so that you know what each change does.Try not to exceed this value of saturation btw considering 1.00 is normal ___________________________________________________ LEVELS FILTER(This part by DrAbdelkader) As for the level filter Use it to give some sharpness/darkening/ decrease the contrast or brightness in the source:

levels(5,1,250,0,250) #--> more effective on black (like black hair, lines, eyes) levels(0,1,250,0,255) #--> makes white brighter levels(0,1,250,-5,250) #--> more effective on dark colors (brown, dark blue, dark red and so on) ,+ve values make the brighter it wont help sharpening levels(0,1,255,0,250) #--> makes bright colors darker too (white will turn grayish,pink,cyan will be darkened)

____________________________________________________ SMOOTHENING Smoothening filters are generally used in combination with sharpeners in case you are working within a size limit since Sharpeners are definitely gonna increase the encode size so Denoisers and Smoothening filters are used before it.Beside if you see some grains that are still left after the use of Denoisers then you may want to smoothen them read about some common smootheners HERE I mostly prefer Deen mostly so will link you just a brushing up from Deen since smootheners can easily whitewash any encode so they must be used very carefully and the preview should be checked everytime you add a smoothener to make sure that no small and finer details are getting whitewashed due to the smoothening
Deen("a2d",2,3,5,0)

_____________________________________________________ SHARPENING Sharpening is used when the edges of the source are blurred out and dont really have any solid edge to them.Sharpeners are one of the best things u miss out on when not going for Pre processing Some common sharpeners are AwarpSharp,MSharpen,Toon,mfToonlite etc.Read about them HERE They work in different ways and produce different results.MSharpen works in 2 steps so its better to use it after getting a hang of filters or it will produce White dots and alias.AwarpSharp can change the structure of the encode itself so even though its my favourite its tough to handle dont use it with strength of over 10 or it will start making straight lines curved making the edges look ragged.vmtoon is the god of Sharpening in itself.its the best sharpener u can get considering it does the work of all the 100 sharpeners that come to ur mind but as always it will be slow and verrrry slow at that.
aWarpSharp(depth=10, blurlevel=2,thresh=0.5, cm=2)

Do remember that awarpsharp only thins the line down,If u want it darkened something like MSharpen or Toon or VMToon is required AwarpSharp may not be needed.DONT FORCEFULLY ADD AWARPSHARP EVERYWHERE.It will remove any boundaries the encode may have had before making it ugly

___________________________________________________ These are only some of the common filters and operations u will be doing on your sources.If you are using DVD/BD isos the filters required also changeFor eg- deinterlacing,detelectine etc In case u need to get a 400p encode u better downsize it now that the filters have been added
spline64resize(720,400)

if you want to keep 720p ignore the last line _____________________________________________________ In case your source needed all of the filters I mentioned your script should look like this atm
LoadPlugin("C:\Program Files\AviSynth 2.5\ffms2.dll") FFVideoSource("C:\Users\abc\Desktop\MyEncode.mkv") spline64resize(1280,720) ConvertToYV12() Tweak(cont=1.0,sat=1.10,bright=0,hue=0)

levels(5,1,250,0,250) #--> more effective on black (like black hair, lines, eyes) levels(0,1,250,0,255) #--> makes white brighter levels(0,1,250,-5,250) #--> more effective on dark colors (brown, dark blue, dark red and so on) ,+ve values make the brighter it wont help sharpening levels(0,1,255,0,250) #--> makes bright colors darker too (white will turn grayish,pink,cyan will be darkened) LoadPlugin("C:\Program Files\AviSynth 2.5\removegrainHD.dll") removegrainHD() Deen("a2d",2,3,5,0) aWarpSharp(depth=10, blurlevel=2,thresh=0.5, cm=2) spline64resize(720,400)

__________________________________________________ Now if you have been tweaking with your settings and checking the preview after every little addition to the filters your pre processing step should be over.try playing it on Media Player Classic now.this will be our new source for the encode

now you need to encode this avs script on any Avi Synth supporting encoder(Will show it to you on next guide) ^_^ __________________________________________________ Q.)Why Pre-processing and Processing need to be separated? A.)Pre-processing is a totally different thing when compared with processing or encoding.Specialised attention should be paid to it and Megui or StaxRip should not be used for both these purposes.Most of the time it will crash megui while loading preview and if you were encoding something all your progress will be lost.its better to use Pre-processing be done on pre-processing software and processing on processing ones __________________________________________________ Some interesting stuff to read about filters---> 1.)Complete guide LINK1 || LINK2 2.)Working with DVD Footage LINK1 3.)Smootheners LINK1 4.)Sharpeners LINK1 || LINK2 5.)Interlace Removal LINK1 ---------------Note -- most of the guides refer it to as Post Processing instead of Pre processing because they are Working with a DVD source and have already done the pre processing separately

You might also like