Monday, December 28, 2009

Encoding h264 with meGUI

meguititletext

This tutorial will show you how to encode your video to h264 with meGUI.

What you'll need:

There are many versions of avisynth, I would suggest that you download the latest stable version, which right now is 2.5.  Then install avisynth, just select the standard installation. Next install meGUI and then open it once you've installed it.

When meGUI is launched it will ask you if you want to update it. Select "yes"

update

Then just click "update", it should have checked all the boxes for you.

update2

Windows with presets will pop-up, I would suggest that you tick them all, because many of them will be useful later on.

checkall

A quick way to select the presets is to right click with your mouse and select check all.

meGUI will say that it needs to be restarted. The installation is finished after it has been restarted.

Now we can select the movie you want to encode. Go to Tools > AVS Script Creator

A window will pop-up. Just select the video input.

videoimport

Then click save.

Open up the meGUI window again.

Next select an option from the encoder setting. I would suggest one of these 3:
  • x264 Unrestricted: 2 Pass Fast - Decent quality, good for people with really slow processors.
  • x264 Unrestricted: 2 Pass HQ - Good quality, probably the best solution for most people, you should at least have a dual core processor if you select this option.
  • x264 Unrestricted: 2 Pass Insane - The best quality you can get. It will take a long time to encode, even with a good processor. With a bad processor you'll be encoding a 10 minute movie for days.

Select the file format as MP4

Next select the audio track for your movie by clicking the button on the Audio Input row. If you don't have a separate audio track then you can just put the video there that contains the audio track.

Next you need to select the encoder setting for the audio. I highly recommend that you use FAAC. Many streaming sites like YouTube use AAC as their audio codec, so this reduces the chance of your video getting a screwed up audio on YouTube and other places.

You can select the audio bitrate by clicking the config on the right side of the encoder setting.

audio

Select ABR and choose the bitrate you want for your video. Anything between 320 and 128 is good.

Select the extension for the audio to be M4A

Now the meGUI page should look like this:

megui

You're almost ready to encode. Click the AutoEncode button in the bottom right corner.

bitrate

Select Average Bitrate and put a vaule there. Anything around 5000-6000 is good. The bitrate affects the video quality the most. A 5000-6000 bitrate is pretty much perfect quality. The bitrate also affects the filesize of the video. No one wants to download a 213471313891231 GB file so I really suggest that you stay below 10000 bitrate. 5000-6000 bitrate gives the best quality/filesize ratio.

Then click Queue

Now select the Queue tab on meGUI

queue

Then click Start.

It should start to work on the different jobs...

job

On the meGUI window there should be listed 4 jobs. Once all the jobs are "done". Then you're video is encoded and ready to be viewed.

When you're done delete all the jobs.

If you get an error, it is most likely because you used the video as the audio track. You can extract the audio track from the video with this program. Select AAC/WMA/WAV as the output format. Once you've got the new audio track go back to meGUI and put it as the Audio Input. Then go to AutoEncode and select the bitrate and queue the jobs. Remember to delete any old jobs from the queue before you queue new jobs.

14 comments:

  1. Awesome gonna try this out, though would be nice if you guys could show us an result also :)

    ReplyDelete
  2. Well the quality is pretty much perfect, but I guess I could do an example, I gotta find something first :p

    ReplyDelete
  3. whats the average size lets say for a 1 minute clip if you use the above settings including the exact bitrate and codec.

    ReplyDelete
  4. Ok thanks, atm i upload my vidoes in avi beacause the other encoding programs just dosent work for me.

    ReplyDelete
  5. with a bitrate of 5500 kpbs you're video will be about 40mb/min

    ReplyDelete
  6. What happend to quality result ?? :(

    ReplyDelete
  7. in status it goes error for job 2 :/

    ReplyDelete
  8. Guys , am I the only one who broke down in those x264 Unrestricted part?
    i couldn't find any presets like that... plz help :(

    ReplyDelete
  9. when i wanted to autoencode, popped up error: Incorrect Colorspace (yv12)
    help..

    ReplyDelete
  10. Errm, this is probably a stupid question
    But when do you use this?
    I can encode it before I put it into vegas, but I'd have to render it and reduce the quality and anyway, the lagarith lossless codec already has perfect quality.

    ReplyDelete
  11. Was strugling a lot with the encoder settings (x264 presets), had the same problem as Slamy. Think I found the correct presets: http://forum.doom9.org/showthread.php?t=139765

    cheers

    ReplyDelete
  12. Wow, it's really an awesome and useful guide. But one question :
    I somehow cannot choose the bitrate oO Always after pressing "AutoEncode" there is only the option "No Target size" and neither "Average Bitrate" nor "File Size" are possible to "mark"...!
    How can I fix this issue?!

    ReplyDelete
  13. I have to ask, does one use the Encoding h264 after you have compiled the .tga files using Virtual Dub? Also, which is the "better" way, using meGUI or ffmpeg? First time attempting a TF2 movie.

    Thanks a lot in advance for your reply!

    ReplyDelete