Jump to content

MeGUI/Guides/Original Guide

From Wikibooks, open books for an open world

NOTE: This Guide hasn't been updated since mid-2006. It's out of date. You Have Been Warned.


There are various steps to encoding content using MeGUI, and these can be automated to different extents:

  1. For MPEG2 input, D2V creation is the first step. This is normally done using Tools->D2V Creator. The options are all self-explanatory. If you have multiple VOB files, select the first one, and the rest will be added later.
  2. For all video input, the next step is creating an AviSynth script. Go to Tools->AviSynth Script Creator to do this.
    • Set up cropping by pressing Auto Crop.
    • Press Analyse to determine what interlacing, if any, your source has. If your source is anime or cartoon-like, you should press 'Source is Anime' BEFORE you press Analyse.
    • Press Suggest Resolution to suggest a vertical resolution to match your horizontal resolution.
    • With all the other settings, a good rule is, 'If you don't know what something does, leave it at its default'. If you want to find out what something does/is, read up on it somewhere else.
  3. Calculate bitrate using Tools->Bitrate Calculator. This isn't required.
  4. Set up video input and settings and queue the video job (in the main window).
  5. Set up audio input and settings and queue the audio job (in the main window). This isn't necessary, as you could choose to keep your original audio, which would just mean adding it later, in the muxing stage.
  6. After encoding, mux the video with the audio using either the AVI muxer (only takes avi and mp3 input), the MP4 muxer (takes mp4, AAC, 264, m4v input), or the MKV muxer (takes just about anything as input).

See, there are quite a lot of steps. These can be automated, the tradeoff being between control and automation.

Using AutoEncode

[edit | edit source]
Note: See AutoEncode for a more comprehensive guide

Using AutoEncode means that steps 3-6 can be set up in one step, as opposed to multiple steps, with waiting in between. To use it:

  • After you have done steps 1-2, go to the main window and select your video input that you want to encode. Set up the video encoding settings to whatever you choose. If you want to encode your audio (instead of keeping the original audio), then select your input files in the audio section, and configure the encoding settings. If you wish to keep your original audio, don't configure any audio in the main window.
  • Press AutoEncode. This will open a new window where you can select the output format (determines which muxer to use) and the target filesize. If you have a target filesize, then, after audio encoding (if there is any), MeGUI will calculate the required video bitrate to reach the target filesize. If you don't care about the filesize, then your best option would be to select 'No Target Size (use profile settings)'. This means that MeGUI will leave the bitrate/QP/CRF to whatever you set up in the main window.
  • If you have original audio that you want to mux at the end, or you have subtitles or chapters that you want to mux, check 'Add additional content'. A muxing window will open when you press Queue. In it, you just configure the correct input files for whatever you want.
  • Press Queue, and you now have your jobs in the queue in the main window


Using the One Click Encoder

[edit | edit source]
Note: For a more comprehensive guide to One Click Encoder, go here.

The OneClick Encoder can automate steps 1-6. This means that you can select your input, configure settings (optional, as it chooses defaults anyway), press go, and leave your computer to come back when it is finished. To use this tool:

  • Create some audio and video profiles which contain the settings you want to use for encoding (required).
  • Go to Tools->One Click Profile Setup. (recommended, but not required. Likewise for step 3)
  • Just as there are video, audio and AviSynth profiles, there are OneClick profiles. Here you can configure the settings that the One Click Encoder chooses by default, and you can group different sets of settings by naming them with different profiles. It is recommended that you create your profiles here, so as to save reconfiguring the One Click Encoder every time you use it, however, this configuration is not required. All the options in this window are also in the One Click Window, so they will be explained further down.
  • Go to Tools->One Click Encoder. Use the '...' button to select your input file. Like the D2V creator, if you have multiple VOB files, just select the first one, and the rest will be added later.
    • If it comes up with a message warning you about a missing Stream Information.txt file, then don't worry. This file is used by MeGUI to name the audio streams. Since it is missing, you will just have to select your track numbers (typically track 1, or track 1 and track 2).
    • Now that the input is selected, everything else is ready to go, but the configuration may not be what you desire. An explanation of the options is below. Feel free to skip it.
      • The output file is just that: the completed output file
      • The audio tracks allow you to choose which audio tracks from the VOB you want (these will either be encoded, or the original audio muxed at the end).
      • The playback method combobox shows the profiles we configured in step 2.
      • The filesize has the target filesize, just like the AutoEncode method. Also like AutoEncoding, you can choose a target filesize of "Don't Care", which will use the settings configured in your video profile instead.
      • In the Advanced Config tab, the Working Directory is where all the intermediate files will be put.
      • The output resolution lets you configure the HORIZONTAL output resolution. The vertical resolution will be adjusted accordingly.
      • The Aspect Ratio (AR) should have been correctly set automatically. If it failed, it will be set to Auto-Detect Later. There isn't really much point in changing this, unless it has been signalled incorrectly in your source (unlikely).
      • Check Signal AR to keep the full resolution and signal the required stretching factor with the video.
      • The AVS profile is the AviSynth profile that will be used for script generation. If you are familiar with AviSynth, you can play around with this in the AviSynth Script Creator. There is a brief explanation of how the AviSynth profiles work at the end. If you are not familiar with AviSynth, leave it at Default Profile.
      • Automatic Deinterlacing automatically detects the source, and inserts the best deinterlacing filter accordingly. This is recommended
      • The Other comboboxes are self-explanatory.
      • The Don't Encode Audio checkbox means that the original audio will be muxed at the end.
    • Press Go to set up the jobs. You are finished

A note about AVC Hardware (iPod, etc) and AVC Levels

[edit | edit source]

There are now some hardware devices which support AVC video (like the iPod, PSP). The AVC standard includes something called levels, which defines a way of categorising how much processing power is required to decode a stream. This is useful for low-power applications like the iPod. In the x264 codec configuration, there is a box which allows the level to be set. Enforcing this level could mean limits on the allowed resolution. MeGUI will tell you what changes need to be made to enforce that level if you go Tools->Validate AVC Level. You can then make the changes. Alternatively, if you have a level set and you use the One Click Encoder, if your chosen resolution is too high for the level, it will find the highest resolution that satisfies the level, and use that.

The upshot of this note means that if you want to make a Hardware-compatible encode, you should download the relevant profile by Sharktooth and use that. If there is a level set, then you can just use this with the One Click Encoder, or you could generate your own script manually and see if it qualifies.

AviSynth audio

[edit | edit source]

AviSynth-based audio uses AviSynth for audio decoding and filtering, just like the video section uses AviSynth. However, at this point in time, AviSynth-based audio behaves in a very similar way to BeSweet-based audio, inside MeGUI. They even share the same dialog box. The process for encoding via AviSynth is still the same. For those who don't know it, here's a quick summary:

  1. Open your input (can be any playable audio file, or can be your already-written AviSynth audio file.
  2. Click config to configure your decoder. To use AviSynth-based encoding, make sure that 'Encode via AviSynth' is ticked. Configure the rest of your settings in the way you see fit.
  3. Press ok to leave the config window, and press queue to queue the audio job. It will run like any other job

AviSynth templates

[edit | edit source]

AviSynth templates are a flexible way of inserting custom filters while retaining some of the automation that MeGUI provides. Of course, you should only play with these if you are familiar with AviSynth, or else you could run into a lot of trouble with broken scripts.

The idea behind the AviSynth profiles is that, for most AviSynth processing, large amounts of your filter-chain will remain the same, while some parts will have to be source-specific (like loading the input, cropping, etc). The way MeGUI manages both parts of this, then, is to allow you to outline the basic structure of the script, then it configures the source-specific values.

How it actually works:

  1. You write a template script.
  2. When MeGUI needs to generate the actual AviSynth script, it loads the template script and it replaces <resize> with the correct resize filter, <denoise> with the correct denoise filter, <crop> with the correct cropping values, and so on for <input> and <deinterlace>. Everything else, it leaves the way it is (don't worry about remembering those keywords; MeGUI has buttons to insert them for you).


That's all that MeGUI does. Now let me give an example. Suppose you have this SUPER FABULOUS TEN-TIMES-BETTER-THAN-ANYTHING-ELSE deinterlacer, but MeGUI doesn't support it. Not to worry, here's what you do: copy and modify the default profile, which looks like

<input>
<deinterlace>
<crop>
<resize>
<denoise>

and make a new profile like this:

<input>
MySuperDeinterlacer()
<crop>
<resize>
<denoise>

Now, when generating the script, MeGUI won't insert its own deinterlacer, but it will leave yours there. Here's an example of what might be the result:

mpeg2source("Yoursource.d2v")
MySuperDeinterlacer()
crop(10,24,-88,-20)
lanczosresize(320,240)
#denoise

Notice that the denoise is commented out. This is what happens if the user chooses there not to be any denoising. The same goes for all the optional filters.

If you want to add a postprocessor, just add a filter at the end. You get the point.