AfterDawn.com
x264 Encoder SettingsYou are viewing Page 1 of 2 -- Go to 1 , 2


x264 Encoder Settings



As broadcast digital video matures, bandwidth limitations and the development of newer and more efficient MPEG-4 compression standards have resulted in a gradual shift away from MPEG-2 video to MPEG-4 Advanced Video Coding (AVC), which is also known as H.264. From low powered applications like mobile phone video to the highest quality high definition movie formats, AVC's many advanced features have positioned it as the successor to a number of legacy formats, including MPEG-2 and MPEG-4 ASP and SP (DivX, XviD, 3IVX, etc,...). It can be found in use on mobile phones, portable media players, and high definition DVD formats from BD-MV (Blu-ray movie) and AVCHD (Blu-ray home movie) to Nero Digital AVC. It's also a popular choice for storing TV captures, as it generally results in files small enough to be stored on a DVD or long term on a HTPC.


What Is x264?


Along with some excellent commercial AVC encoders, like MainConcept and the Ateme encoder used in Nero, the open source x264 library has become a popular option for creating AVC files. Although there are command line x264 encoders available for Windows, they're only one implementation of the core x264 code. It's also found in programs like VLC and ffmpeg, allowing it to be used across a variety of operating systems.

x264 Command Line Encoder


For this guide we'll be discussing a command line encoder because that's typically how Windows programs implement encoding. The benefit to this is that it often allows you to change encoding settings to match your source and output. This may be done using a GUI that handles the command line behind the scenes, a list of editable command line options, or even direct editing of a prewritten x264 command line. You may even want to simply use x264 directly with a command line interface1 (CLI).


Sounds Complicated


The most important thing to remember is that you don't have to write the commands for x264 yourself. There are a number of programs which do the work for you, presenting you with a GUI which uses checkboxes, lists, and text boxes to set various options with. While you can certainly stick to complete automation, you may find that you want to adjust the settings a little, or even just read the command being generated. While it may be intimidating if you're not used to working on the command line, reading and even writing these commands is simpler than you might think.

For now we'll stick to the most basic settings. These settings deal primarily with general encoding parameters like bitrate and GOP2 structure, although some will be AVC-specific features3 which may affect quality, size of encoded video, encoding time, and even CPU power required for playback. Eventually more information will be added on more advanced features, but most of the time you shouldn't need to know more than the basics.


Profiles


In addition to direct input on the command line, many programs make use of profiles. Profiles encompass an entire set of encoder settings in XML format, which is similar to HTML. You can create your own custom profiles, or use profiles created by others. In reality your better off starting with someone else's profile, which you can then modify to match your preferences. Programs that make use of these profiles typically come bundled with several that are customized for a particular quality, size, encoding speed, or playback device. In addition to discussing each setting, the relevant profile line or lines will be discussed.





Required Software





x264

x264 is an open source AVC (H.264 / MPEG-4 Part 10) encoding library used by a number of projects across different platforms from Windows to Linux and MacOS X. This command line encoder is an unofficial build for Windows of the x264 source. It can be used by itself, or with a number of GUI packages, including AutoMKV, MeGUI, and StaxRip.




AviSynth

AviSynth is a powerful open source editor, and is generally used to provide source video to x264 for encoding. Regardless of whether you choose to use x264 directly on the command line or a third party GUI like MeGUI or StaxRip you'll need to have it installed first. You can find more information on AviSynth in our guide on Using AviSynth 2.5. It includes not only basic instructions for AviSynth, but also descriptions of a number of built-in filters, as well as third party plugins.


Related Software




ffdshow

ffdshow is a DirectShow decoding filter for decompressing several video formats, including DivX, XviD, WMV, MPEG-1 and MPEG-2 movies. ffdshow is one of the best DirectShow decoders for MPEG-4 video, especially AVC. It can also be used for decoidng other video formats to use as sources for the x264 CLI encoder. You can find detailed instructions for installation and configuration of ffdshow's video and audio decoding features in our guide for ffdshow Installation and Configuration.


mkvtoolnix

MKVToolnix is a set of tools to create, alter and inspect Matroska files. With these tools one can get information about (mkvinfo) Matroska files, extract tracks/data from (mkvextract) Matroska files and create (mkvmerge) Matroska files from other media files. AVC video is often stored in the MKV (Matroska) container, allowing the use of AC-3 (Dolby Digital) audio. Our guide titled Creating MKV files with mkvtoolnix provides instructions for creating MKV files.


Haali Media Splitter

Haali Media Splitter is a DirectShow splitter for MKV (Matroska), MP4, MPEG-2 TS (transport stream), MPEG-2 PS (program stream), OGG, and AVI files. AVC video is generally stored in either MP4 or MKV files, neither of which is natively supported in Windows or DirectX (DirectShow). If you need help with installation you can refer to our Introduction to Haali Media Splitter.



Continued On Page 2



Next we'll look at various options used for the x264 CLI and discuss what they do and when you might use them.

Page 2 - Encoding Options



x264 Encoder SettingsYou are viewing Page 1 of 2 -- Go to page 1 , 2

1Command Line Interface

A program which can be run from a Windows command prompt or UNIX/Linux terminal window or standard TTY interface has a Comand Line Interface, or CLI. Many programs which are built around a GUI also include command line options, allowing them to be controlled by third party applications through the CLI.... (Read More)
(Return)

2Groups of Pictures

One of the standard tools of modern video compression is the use of the GOP or Group of Pictures. Unlike traditional analog and digital videotape, not every frame in a GOP can be decoded (displayed) without any other frame. Instead, one or more keyframes in each GOP contain complete pictures, while the remaining frames only include the changes from the previous frame. These frames are called Delta frames. Although GOPs can be made up of only keyframes, tipically called I frames, they typically also include P (predictive) and B (bidirectional predictive) frames, which take less space, but require other I or P frames for playback.
(Return)

3More About the AVC Encoding Standard

Rather than a specific codec, Advanced Video Coding (AVC) is a set of standards that can be implemented by anyone willing to pay the necessary licensing fees. It was developed by the Joint Video Team, a partnership between the Motion Pictures Experts Group (MPEG) and International Telecommunications Union (ITU). You can find more about the specifications for AVC in our glossary entry for MPEG-4 Part 10.
(Return)

table of contents

  1. 1. Introduction
  2. 2. Encoding Options
Written by: Rich "vurbal" Fiscus
Last updated: 2 April 2008