What is this guide about?
This guide aims to explain, to people just starting out with H.264 encoding, what the various options in x264 mean and how they affect the encoded video. For each option, a description is provided, as well as a list of possible options (and their descriptions), the command line version of the option and the recommend setting is shown in underline
If you are reading this guide, then it must mean that you already know all about H.264 and H.264 playback. If you don't, head on to our H.264 Playback Guide
to get acquainted with this new video compression format.
Future versions of this guide will feature more information regarding compatibility (eg. with QuickTime, iPod, PSP, Xbox).
What is x264?
is a free H.264 encoder. It is mainly aimed at intermediate users, so it has lots of options that will be confusing to the average user. If you don't know your trellis from your pyramid, then this guide will hopefully help you to understand things a bit better (or just enough so that you don't have to select options at random).
The x264 options discussed in this article are ones that can be inputted using the command line version of the tool or through a Windows GUI software called StaxRip
. A separate StaxRip H.264 Encoding Guide
is also available, so don't fret if you can't figure out how to use this software (or to even install it).
Why use StaxRip?
Or rather, why not use MeGUI? MeGUI is probably the best tool around with dealing with x264, but it can be daunting for new users because of the numerous options that are included. StaxRip is aimed more at beginners, and so has (as the author states) only the important x264 options available to configure. Plus, StaxRip assumes no knowledge of Avisynth scripting.
You can also read our MeGUI H.264 Conversion Guide
Basic x264 usage:
At it's most basic, x264 is a command line tool, where you can specify the input, output and encoding options all through a glorious black-background/white-text command line interface.
The command line syntax is as follows
x264.exe options --output output.*** inputfile.*** widthxheight
A simple example of a x264 command line entry:
x264.exe --bitrate 1087 --output "test.mp4" "test.avi"
A more complicated example of a x264 command line entry:
x264.exe --pass 2 --bitrate 1087 --stats "test.stats" --ref 3 --bframes 3 --b-pyramid --weightb --b-rdo --bime --direct auto --filter -4:-3 --analyse all --8x8dct --subme 6 --me umh --trellis 1 --mixed-refs --progress --no-psnr --output "test.264" "test.avs"
There are many graphical user interfaces (GUIs) which allow you to set these options through a normal Windows program, and StaxRip is one of them.
Throughout this guide, whenever an x264 option is explained, both the command line equivalent and the StaxRip/GUI version of the option will be shown.