-1p Encode in 1-pass mode
-2p Encode in 2-pass mode
-3p Encode in 3-pass mode
-qp Encode in fixed-quant mode
-crf Encode in constant rate factor mode
<passmode>-p<preset>[-t<tune>][-pf<profile>]
Use a predefined H.264 quality preset, where <passmode> is the desired encoding mode (-1p or -2p
or -3p or -qp or -crf) and <preset> is the desired quality preset to use (see below). Note that
the -t and -pf options only work with the x264 presets below! See examples at the end of this
option.
cp-------->Loadacustompresetfile(seeexamplebelow)ulq------->UltraLowQualitypresetelq------->ExtremeLowQualitypresetvlq------->VeryLowQualitypresetlq-------->LowQualitypresetmq-------->MediumQualitypresetnq-------->NormalQualitypreset(recommended)hq-------->HighQualitypreset(recommended)vhq------->VeryHighQualitypreset(recommended)ehq------->ExtremeHighQualitypresetuhq------->UltraHighQualitypresetihq------->InsaneHighQualitypresetnlq------->NearLosslessQualitypresetfghq------>FilmGrainoptimizedHighQualitypresetani------->Animepresetanihq----->AnimeHighQualitypresetvdhq------>VDPAU/DXVAHighQuality(High@L4.1)presetvdehq----->VDPAU/DXVAExtremeHighQuality(High@L4.1)presetvdihq----->VDPAU/DXVAInsaneHighQuality(High@L4.1)presetfl-------->FlashPlayerpresetflhq------>FlashPlayerHighQualitypresetqt-------->QuickTimepresetqthq------>QucikTimeHighQualitypresetbd40------>Blu-ray(Main@L4.0)presetbdhq40---->Blu-rayHighQuality(High@L4.0)presetbd41------>Blu-ray(Main@L4.1)presetbdhq41---->Blu-rayHighQuality(High@L4.1)presetavchd----->AVCHD(Main@L4.0)presetavchdhq--->AVCHDHighQuality(High@L4.1)presetsdb------->Stand-aloneHWplayersSD(Baseline@L3.1)presetsdm------->Stand-aloneHWplayersSD(Main@L3.1)presetsdh------->Stand-aloneHWplayersSD(High@L3.1)presethdb------->Stand-aloneHWplayersHD(Baseline@L4.1)presethdm------->Stand-aloneHWplayersHD(Main@L4.1)presethdh------->Stand-aloneHWplayersHD(High@L4.1)presetag1------->AndroidG1presetag1hq----->AndroidG1HighQualitypresetipc------->AppleiPodClassicpresetipchq----->AppleiPodClassicHighQualitypresetip-------->AppleiPodpresetiphq------>AppleiPodHighQualitypresetiph------->AppleiPhonepresetiphhq----->AppleiPhoneHighQualitypresetatv------->AppleTVpresetatvhq----->AppleTVHighQualitypresetar-------->Archos605presetarhq------>Archos605HighQualitypresetar5------->Archos5presetar5hq----->Archos5HighQualitypresetbb-------->Blackberry9000presetbbhq------>Blackberry9000HighQualitypresetnks60----->NokiaS60presetnks60hq--->NokiaS60HighQualitypresetpsp------->SonyPSPpresetpsphq----->SonyPSPHighQualitypresetps3------->SonyPS3presetps3hq----->SonyPS3HighQualitypresetmz-------->MicrosoftZunepresetmzhq------>MicrosoftZuneHighQualitypresetmx-------->MicrosoftXBOX360presetmxhq------>MicrosoftXBOX360HighQualitypresetultrafast(x264preset)superfast(x264preset)veryfast(x264preset)faster(x264preset)fast(x264preset)medium(x264preset)slow(x264preset)slower(x264preset)veryslow(x264preset)placebo(x264preset)
Example of presets usage: h264enc-2p-phq
The above example will encode the DVD or input video file in 2-pass mode using the High
Quality (HQ) preset
Load a custom preset from a file:
h264enc-2p-pcp/path/to/file/preset.cfg
Please have a look at the preset.cfg file inside the h264enc package to give you an example
on how to write a custom preset. The preset.cfg file is usually located inside the doc
directory of the h264enc package.
Examples of x264 presets/tune/profiles usage:
h264enc-2p-pslowh264enc-2p-pslow-tfilmh264enc-2p-pslow-pfmainh264enc-2p-pslow-tfilm-pfhigh
The first example encodes the input with x264's slow preset. The second one does the same
but tunes the encode settings for film footage. The third example is as the first one but
selects the main H.264 profile and the last example uses both a tuning for film and selects
the high H.264 profile. You can also switch the -t and -pf options, eg: h264enc-2p-pslow-pfmain-tfilm-b/path/to/file/batchfile
Load a batch file generated by this script. This option can be useful for testing or debugging
the MEncoder parameters and for batch encoding.
-e Edit the config file from within the terminal. This option defaults to using the 'nano' text
editor but one can manually set his preferred editor in the EDITOR variable of the config file.
The config file is located in /home/username/.h264enc-r Reset configuration file. As of version 8.5.7, h264enc uses a configuration file which contains
the paths to the programs needed for its correct operation. This option tells the script to remove
and recreate the config file using the default values. It can be used to restore the original
values of the config file in case the user has modified it and wants to get rid of those
modifications. It is also used for resetting the config file in case the user has installed a
required program after h264enc has generated its config file. If this is the case, the config file
will not contain the path to the newly installed program so one has to reset the file in order to
find it. This is because the config file is generated/updated only once: if it's not available on
the user's system and during config version updates. The configuration file is located in
/home/username/.h264enc/config-sc Perform a sanity check. This will check for the programs which are required for the correct
operation of this script and it will print the status in a list. It will also display which audio
codecs are supported by MEncoder.
-scan Scan the DVD disc and display extensive information about it. With this option, one can display
or export the information to a file on disk in text, perl, python, ruby or xml format.
-iso Create an ISO image of the DVD disc. Note that this option does no do any stripping of specific
titles, audio languages and/or subtitles. It dumps the DVD content 1:1 to an ISO image.
-spr Calculate the Storage and Pixel Aspect Ratios (SAR/PAR) for various resolutions.
-mfr Calculate the maximum allowed frame references within DPB (Decoded Picture Buffer) limits for
different H.264 levels and resolutions.
-bpp This is an informative option which lets you calculate the Bits Per Pixel (bpp) values for various
resolutions. The bpp value represents how much bits each pixel gets. The higher the bpp value is,
the more distinct colors the pixels will have which leads to a higher overall picture quality.
Note that these values are not absolute! For video content with a lot of black in it, a bpp value
of 0.14 may look very good. Video content with a lot of high motion scenes may still look bad with
a bpp value of 0.20, so this really depends on the content you are willing to encode and the
resolution you choose when scaling down.
-bpb This option is similar to the -bpp one, except it calculates the Bits Per Block (bpb) values for
various resolutions. The bpb value expresses how many bits each 16x16 macroblock gets. Good bpb
values are between 37-52. As is the case with Bits Per Pixel, the bpb values are not absolute and
depend on the video content you are willing to encode and the resolution you choose when scaling
down.
-help Display built-in help of the h264enc script and exit
-v Display version of the h264enc script and exit