(Background: I run an HD video sharing site, though I'm not going to mention its name here. I might mention it in the “pimp your link” section if people are interested. I try to be an x264 “evangelist” in order to improve the way people compress videos since so many people are using inferior and outdated methods.)
Unfortunately a lot of the tutorials on the web are very out of date (e.g. using divx or xvid or windows media) or sometimes involve using unsupported and problematic techniques (e.g. H.264 in avi or x264vfw).
There's also a gap between the people that develop encoders and the people that make videos and use them with the former assuming ridiculous amounts of knowledge in the latter. This is something I'd like to help correct.
This is a Windows oriented tutorial but for Mac/Linux users there's a similar, but less powerful tool out there called Handbrake. Step 8 onwards is similar except the names might be slightly different.
Apologies if this repeats obvious information or gets too complicated at times.
H.264 is the latest and greatest of all video formats so far. x264 is the best of the H.264 encoders although it has a learning curve and so is not used as often as it should. It is heavily used by large companies (Google, Facebook, Vudu to name a few) and its open source nature means it can be modified for live broadcast, Blu-Ray authoring and web video creation as well as many more implementations.
Comparisons can be found here:
(The results of Quicktime would only be a little better than MPEG-2)
If you're aiming for the best picture quality you should always use x264 instead of your usual encoder (especially if that encoder is Quicktime). x264 is one of the most heavily optimised pieces of software on earth and is also very fast compared to other encoders.
Virtually all the tools associated with x264 are free and open source!
The easiest way to get started with x264 is to use MeGUI.
1. Download MeGUI from here: SourceForge.net: meGUI: Files
2. MeGUI should download most of the tools necessary.
3. Output your material from your editing package, either losslessly if possible, or with a very high bitrate so that the picture is effectively lossless. This should be done progressively You will also need the correct input filters for your material (e.g. for H.264, ffdshow or CoreAVC)
4. Open notepad and copy and paste the following:
5. Save this file as input.avs .
6. Open MeGUI and using the button marked “...” in Avisynth input at the top select your input.avs.
You can also set audio encoding parameters below but this guide only deals with video right now. You should see a preview of your video.
7. If you like you can choose one of the presets and skip the next few steps. However, it's worth understanding what the main settings in x264 do.
8. Find an x264 preset you wish to start from.
There are two main modes in x264. 2-pass bitrate and CRF (sometimes called “constant quality”).
2-pass is recommended if you need to hit a target filesize. This method is like other encoders. You choose a bitrate and go from there. Select “Automated 2-pass” if you want this method. Also, check the box marked “Turbo” as this will speed up your first pass significantly with a very, very minimal quality loss.
CRF is faster and recommended if you don't need to hit a target size. 18 is considered visually transparent though in many cases you can go up to 22-25 without that much quality loss. As CRF value goes up, filesize goes down.
Personally, I recommend CRF. It's best to stay with High Profile selected unless you have restrictions (e.g iPhones or other media devices)
The main settings for quality in the other tabs are as follows:
RC and ME
M.E Algorithm should be Multi-hex. Set this higher if you have time to spare
Subpixel Refinement is the most important setting of them all. 8 or 9 is recommended.
CABAC should be on unless you have specific reasons. (limited playback CPU speed)
Trellis can be turned up to 2 if you have the time. 1 should be OK though.
Adaptive B-frames should be on 2 unless you have restrictions on how long your encode time should be.
9. Save your settings and choose between MKV and MP4 – the only worthwhile formats around right now (except for transports streams, which are used in Blu-Ray and broadcast)
10. Click on Enqueue. Change the tab to “Queue”, select the first job and click on Start.
Note: Quicktime has a very limited decoder and so unless you use the Quicktime preset most of your encodes will not work in Quicktime.
The results you get should outclass most other encoders at a similar bitrate.
In fact there are loads more settings you could change. There are also lots of other things non-x264 related that could be done. Ask me if you really want to know.
x264 (not x.264 or anything else) = an H.264 encoder
H.264 (or MPEG-4 Advanced Video Coding) = The standard by which H.264 encoders and decoders follow (e.g. Quicktime, Mainconcept etc)