Basics of MeGUI's Avisynth Creator

Okay, I thought I would go ahead and post this little explanation of MeGUI's excellent Avisynth Creator tool. It's a fantastic tool, and not just with respect to use with MeGUI. I (and many others, I'm sure) have used the Avisynth Script Creator to create scripts for their personal use in a number of different situations. It is a nicely versatile tool with a number of useful features varying from Anamorphic encoding to an interlacing detector. Well, let's get started.

First, start MeGUI and go to Tools -> AVS Script Creator. You will see a window like the one pictured below. This is the main window were the magic starts brewing!



Right away, I'm sure many of you can already guess what most of this is for. For those of you who can't, or those of you who just feel like reading something here is an explanations of each option:

Video Input

Yep, you guessed it. You select the input file here. You can select pretty much anything from a vob to an avi to an mkv here. Once you have selected your desired file, you should receive a preview window of your input clip. You can close it if you want, or just move it out of the way.

Input DAR

This little box just shows the input Display AspectRatio of your source. Useful for those of you who know what that means, but not a big deal for those of you who don't.

Clever (TM) Anamorphic Encoding

Ah, one of the sweet features of MeGUI. This little box simplifies encoding anamorphic clips immensely. It offers 5 drop-down options:

  1. Resize to mod16: Pretty simple. When creating an anamorphic video, this will force any output video to be mod-16 compliant. This means that the width and height will both be equally divisible by
    1. No remainder. So, if you do any cropping (usually of black bars) and your cropped output is not mod-16, MeGUI will automatically resize to mod-16 for you, fixing any funky problems.
  2. Overcrop to mod16: Again, a pretty simple idea. This is similar to #1, but instead of resizing after you have finished your cropping, this option will increaseyour crop values to result in a mod-16 output. This is my personal favorite, as I usually prefer to lose a little bit of the perimeter of the image instead of resizing the whole output. Saves time and results in a better quality output.
  3. Encode non mod16: This is almost like turning off Clever Anamorphic Encoding option in the first place. The main difference is that the output DAR (Display Aspect Ratio, remember?) is still signaled to the encoder (which is a good thing). In fact, that signaling is often the most important part. If the signaling is not sent to the encoder, your encodes will not playback their proper aspect ratio, thus defeating the whole purpose of anamorphic encoding. Every option in the Clever Anamorphic Encoding drop-down will signal the aspect ratio, so you don't have to worry about that.
  4. Crop mod4 horizontally: All this option really does is make sure that any cropping you do is mod-4 with respect to the width. So, say if you crop 3 pixels from the right of your source video, then this option sees that 3 is not mod-4, and crops an extra pixel from the right to make it safely mod-4.
  5. Under crop to mod16: This acts similar to Overcrop to mod16, just in reverse. So essentially, after you have finished cropping, if your crop values are not mod-16, MeGUI will decreaseyour cropping values to reach a mod-16 value. Get it?

Avisynth Profile

This is a quick selection box for loading your favorite Avisynth profile. If you click on the "Config" button, you can see what I am talking about. It's a pretty self explanatory little setup, but if you guys want me to write up a post about it, I would be more than happy too. Just let me know in the comments section. You can usually leave this option alone if you don't know what it is or how to use it.


Ah yes, this little option. Well it's this really new-fangled uber-delta-super cool way to...crop. Okay, you get it. Each box represents the number of pixels to be cropped from the top, left, right, and bottom of your source video. If you have the preview window open (and if you don't, just press the "Re-open original video player" button), you can get a live preview of your cropping values. Freakin' awesome, ain't it? For those of you who are super lazy, you can even use the "Auto Crop" button to automatically detect and crop black bars from your source video (which are most often seen in DVD sources). Just be sure to check that the "Auto Crop" didn't crop too much of your source, as it can screw up a little some times (hey, it ain't exactly a perfect science, so give it a break). Although in all honesty, it's pretty accurate about 95% of the time.


And here you get to transmorgify your video to what ever resolution you like!! (Queue evil laugh). Okay seriously, you can use this option to resize your video to another output resolution if you are so inclined. Most of the time I don't use this (you all know how I feel about resizing), but if you are encoding for an iPod for example, this little option can be dead useful! It will even "suggest" a mod16 resolution for you if you are so inclined (I'm usually not, but who cares). Use it if you want to, otherwise keep it disabled.

Apply Auto Preview

You need this checked if you are going to be live-previewing your cropping/resizing like I talked about earlier. It's usually on by default, so only turn it off if you don't want it. It's a pretty harmless option, so don't fret over it too much.


Okay, next up is the Filterssection. This is where most of the magic happens.


Look at all o' them cool options! Let's start at the top shall we!

MPEG2 Source / AVI Source / DSSource / DGx Source

Right oh! These tabs at the very top act on a per-source-filter basis. It should be pretty self explanatory actually. For the most part, the defaults are fine. For example, I always leave Color Correction on, but leave Mpeg2 Deblocking off (which is default anyways). When dealing with AVI's or MKV's/MP4's, you may want to look at the AVI Source / DSSsourcetab if you are having trouble loading your file correctly. Again, all options should be pretty self explanatory. The one exception is the Prefer DSSource2... option. This is used when you have Haali's Media Splitter installed, and want a frame accurate DirectShow source with no audio. Actually, I would recommend DSSource2 in that instance as it can really help with sync issues, or when dealing with Variable Frame Rate material.


Admittedly one of the cooler features of MeGUI is it's "automagic" deinterlacing routine. What this do-hickey does is analyse your input file for interlacing patterns, and suggest proper Deinterlacing/DeIVTCing techniques. I have to disclaim, however, that it isn't always 100% accurate. Obviously, the best option is to analyze your source material by hand, but who has time to do that? Usually MeGUI's recommendations are pretty spot on (except when dealing with really tricky material), and should work fine in most cases. Just test the output script first by playing it and see if the output has any artifacts or anything of that sort before encoding.

Most people just use the big rosy Analyse button, but if you happen to know the source type and field order, you can greatly speed up the process. Of course, if you already do know these tidbits of info, then chances are you already know how to handle the deinterlacing/deIVTCing process yourself.

One last note, don't forget to check the "Source is Anime" checkbox before you press Analyse when dealing with anime content.Otherwise, you run the risk of getting some really false readings when you analyze your material.

Resize Filter

This is where you can select your resizing filter. If you know what your doing (or even if you don't), you can use this drop down box to select your preferred resizer. The defaults are just fine, but play around with the options if you have some time to find something you like. I'm a little partial to Spline64resize myself.

Noise Filter

Again, pretty self explanatory. I don't use this option that much, as I prefer to select my own denoiser (since I have tested so many and know which ones I like). You are more than welcome to give the four options a spin for yourself. You can even see which denoiser is used for which setting by selecting a particular profile and then clicking on the Edit tab and looking at the denoiser line.


Use this option if you want to "hardcode" or "burn in" your subtitles into your source material. Useful for encoding videos for devices that don't support soft subtitles, such as an iPod or your grandmother's ancient PC.


[![MeGUI-Avisynth-script-creator_edit][]][]The Edit tab shows what your final script will look like. You can edit each line by hand if you so desire, or leave it right at default. Each line is labeled corresponding to its function in the script, so it should be very clear.

Load DLL

Use this button to navigate to a desired plugin for direct loading into the script. You will know what this is if you know about plugin loading in Avisynth. Otherwise, don't stress over it. It's just a "Make your life slightly easier when scripting" option.


Examples of external plugins include RemoveGrain.dll, awarpsharp.dll, mvtools2.dll, fft3dfilter.dll, etc... But Avisynth plugins are for another tutorial.

And so we have come to the end! You can either save your script and get encoding, or give it one last preview before your done! It's your choice! Happy encoding!

[![MeGUI-Avisynth-script-creator_options][]]: {filename}/images/2009/08/MeGUI-Avisynth-script-creator_options.png [![MeGUI-Avisynth-script-creator_filters][]]: {filename}/images/2009/08/MeGUI-Avisynth-script-creator_filters.png [![MeGUI-Avisynth-script-creator_edit][]]: {filename}/images/2009/08/MeGUI-Avisynth-script-creator_edit.png