h264enc(1)

NAME
h264enc - the interactive shell script ripper

SYNOPSIS
h264enc [-1p|-2p|-3p|-fq|-b|-sc|-scan|-iso|-bpp|-bpb|-v|--help] [-p <preset>] [preset_file]

DESCRIPTION
h264enc is an advanced and powerful interactive menu-driven shell script which uses the encoding utility MEncoder from the MPlayer project. The script can be used to encode either DVDs or regular video files to the high-quality MPEG-4 video format H.264 (also known as AVC (Advanced Video Coding) or MPEG-4 Part 10). At the moment, the script supports virtually all options of the libx264 library. h264enc is targeted primarily at power users or users who understand the process of video encoding and want to tweak their settings in order to achieve the best possible quality/file size of their encodes. As of version 5.1, the h264enc package includes the Sharktooth and MP4Guy matrix files.
h264enc has its own Web site with a rather extensive FAQ which you can visit at http://h264enc.sourceforge.net

REQUIREMENTS
- MEnocder >= 1.0rc2 compiled with libx264 support
- libx264
- lsdvd
- dvdxchap from 'ogmtools' (for DVD chapter export)
- LAME (for MP3 audio encoding)
- FAAC (for AAC audio encoding)
- neroAacEnc (for AAC+ audio encoding)
- oggenc (for Vorbis audio encoding)
- MP4Box from 'gpac' (for AVI -> MP4 container conversion)
- mkvtoolnix (for AVI -> MKV container conversion)
- ogmtools (for AVI -> OGM container conversion)
- tsMuxeR (for AVI -> TS container conversion)

FEATURES
- Support for 1-pass, 2-pass, 3-pass and fixed-quant encoding modes
- Support for 41 different video quality presets
- Support for DVDs and video files
- Support for dumping the DVD content to an ISO image
- Support for different containers (AVI/MKV/MP4/OGM/TS)
- Support for displaying/exporting extensive DVD information
- Support for video files with more than one audio and video stream
- Support for auto detecting the longest DVD title
- Support for encoding from a different DVD angle
- Support for auto detecting available DVD chapters
- Support for auto detecting available DVD subtitles
- Support for hard coding external subtitles when encoding video files
- Support for auto detecting DVD/video file cropping values
- Support for adaptive auto detection of the source resolution
- Support for bypassing scaling if using the original resolution
- Support for frame rate conversion
- Support for setting the encoder priority level ("nice" values)
- Support for automatic brightness/contrast control
- Support for interlaced encoding
- Support for interlacing progressive content
- Support for deinterlacing DVDs/video files with a user selectable deinterlacing filter
- Support for Inverse Telecine/Pullup/Hard Telecine/3:2 Pulldown for NTSC content
- Support for denoising DVDs/video files with a user tunable denoise filter
- Support for adding noise to the encoding
- Support for deblocking/deringing of video files with a user tunable deblocking filter
- Support for user tunable (un)sharp mask/gaussian blur
- Support for automatic video bitrate calculation
- Support for inspecting the desired options before encoding
- Support for exporting the MEncoder options for debugging purposes
- Support for loading a options file generated by this script
- Support for 11 different software scalers
- Support for setting the output frame rate value
- Support for auto detecting available DVD/video file audio channels
- Support for various audio codecs [MP2/MP3/AC3/AAC/AAC+/VORBIS/WMA/FLAC/PCM/ADPCM]
- Support for audio resampling
- Support for audio volume normalization [MP2/AC3/AAC/AAC+/VORBIS/WMA/FLAC/PCM/ADPCM only]
- Support for setting the audio volume gain [MP2/AC3/AAC/AAC+/VORBIS/WMA/FLAC/PCM/ADPCM only]
- Support for audio input gain [MP3 only]
- Support for using more than 2 audio channels [AC3/AAC/VORBIS/FLAC/PCM only]
- Support for AC3 Dynamic Range Compression [AC3 only]

PARAMETERS

-1p Encode the DVD or video file in 1-pass mode

-2p Encode the DVD or video file in 2-pass mode

-3p Encode the DVD or video file in 3-pass mode

-fq Encode the DVD or video file in fixed-quant/constant ratefactor mode

-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.

-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 out of the DVD content and store it to disk.

-bpp
    This is a 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.

<passmode> -p <preset>
    Use a predefined H.264 quality preset, where <passmode> is the desired encoding mode (-1p or -2p or -3p or -fq) and <preset> is the desired quality preset to use (see below). Please note that quality presets in H.264 are different when compared to quality presets in other codecs like Xvid or DivX. For example, the High Quality (HQ) preset in H.264 corresponds to the Extreme High Quality (EHQ) preset (where Insane High Quality (IHQ) being the highest possible quality) in Xvid or DivX. This comes from the fact that the H.264 codec uses a much better motion estimation method and suffers much less from DCT artifacts than Xvid or DivX. Unless you have a powerful supercomputer or a lot of patience, you should stay away from the Ultra High Quality (UHQ) and Insane High Quality (IHQ) H.264 presets as they will require days to encode the material.
    You can choose from 41 different presets:

    cp --------> Load a custom preset file (see example below)
        ulq -------> Ultra Low Quality (ULQ) preset
        elq -------> Extreme Low Quality (ELQ) preset
        vlq -------> Very Low Quality (VLQ) preset
        lq --------> Low Quality (LQ) preset
        mq --------> Medium Quality (MQ) preset
        nq --------> Normal Quality (NQ) preset (recommended)
        hq --------> High Quality (HQ) preset (recommended)
        vhq -------> Very High Quality (VHQ) preset (recommended)
        ehq -------> Extreme High Quality (EHQ) preset
        uhq -------> Ultra High Quality (UHQ) preset
        ihq -------> Insane High Quality (IHQ) preset
        nlq -------> Near Lossless Quality (NLQ) preset
        ani -------> Anime (ANI) preset
        anihq -----> Anime High-Quality (ANIHQ) preset
        f9 --------> Flash Player 9 Video Profile (F9) preset
        f9hq ------> Flash Player 9 High-Quality Video Profile (F9HQ) preset
        sdb -------> Stand-alone HW players SD (Baseline@L3.1) preset
        sdm -------> Stand-alone HW players SD (Main@L3.1) preset
        sdh -------> Stand-alone HW players SD (High@L3.1) preset
        hdb -------> Stand-alone HW players HD (Baseline@L4.1) preset
        hdm -------> Stand-alone HW players HD (Main@L4.1) preset
        hdh -------> Stand-alone HW players HD (High@L4.1) preset
        icvp ------> Apple iPod Classic Video Profile (iCVP) preset
        ichqvp ----> Apple iPod Classic High-Quality Video Profile (iCHQVP) preset
        ivp -------> Apple iPod Video Profile (iVP) preset
        ihqvp -----> Apple iPod High-Quality Video Profile (iHQVP) preset
        ipvp ------> Apple iPhone Video Profile (iPVP) preset
        iphqvp ----> Apple iPhone High-Quality Video Profile (iPHQVP) preset
        avp -------> AppleTV Video Profile (AVP) preset
        ahqvp -----> AppleTV High-Quality Video Profile (AHQVP) preset
        nks60vp ---> Nokia S60 Video Profile (NKVP) preset
        nks60hqvp -> Nokia S60 High-Quality Video Profile (NKHQVP) preset
        pspvp -----> Sony PSP Video Profile (PSPVP) preset
        psphqvp ---> Sony PSP High-Quality Video Profile (PSPHQVP) preset
        ps3vp -----> Sony PS3 Video Profile (PS3VP)
        ps3hqvp ---> Sony PS3 High-Quality Video Profile (PS3HQVP)
        zvp -------> MS Zune Video Profile (ZVP) preset
        zhqvp -----> MS Zune High-Quality Video Profile (ZHQVP) preset
        xvp -------> XBOX 360 Video Profile (XVP) preset
        xhqvp -----> XBOX 360 High-Quality Video Profile (XHQVP) preset

    Example of presets usage: h264enc -2p -p hq
        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 -p cp /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.

--help
    Display built-in help of the h264enc script and exit

-v  Display version of the h264enc script and exit

SEE ALSO
mencoder(1), lsdvd(1), dvdxchap(1), lame(1), mkvmerge(1), ogmmerge(1), mp4box(1)

AUTHORS
h264enc was written by Grozdan Nikolov <neutrino8@gmail.com>

This manual page was written by the author of h264enc (see above)

BUG REPORTS
Please send all bug reports and/or questions/suggestions to <neutrino8@gmail.com>