handbrakecli
command-line interface for HandBrake, a powerful open-source video transcoder
TLDR
Convert a video using a preset
SYNOPSIS
HandBrakeCLI [-i input] [-o output] [--preset name] [-e encoder] [-q quality] [options]
DESCRIPTION
HandBrakeCLI is the command-line interface for HandBrake, a powerful open-source video transcoder. It converts videos between formats, rips DVDs and Blu-rays, and can significantly reduce file sizes while maintaining quality.
The tool uses presets to simplify common encoding scenarios. Built-in presets target specific devices (Apple TV, Android, Roku) or quality levels (Fast 1080p30, HQ 1080p30 Surround). Custom presets can be exported from the GUI and imported into CLI workflows.
For quality-based encoding, the RF (Rate Factor) value controls the quality-to-size tradeoff. For x264/x265, values of 18-22 provide high quality, 23-28 provide smaller files with acceptable quality. Lower numbers mean higher quality and larger files.
HandBrake supports hardware acceleration on supported systems: NVIDIA NVENC, AMD VCE/VCN, Intel QuickSync, and Apple VideoToolbox. Hardware encoders are faster but may produce larger files at equivalent quality.
Audio and subtitle tracks can be selected, converted, or passed through. Multiple audio tracks can be included with different encodings. Subtitles can be burned in or kept as soft subs.
PARAMETERS
-i, --input source
Input file, directory, or device.-o, --output file
Output file path.--preset name
Use named preset (see --preset-list).--preset-list
List available presets.-t, --title number
Select title number (for DVDs/Blu-rays).--scan
Scan input without encoding.-e, --encoder codec
Video encoder: x264, x265, nvench264, nvench265, vceh264, vceh265, svt_av1.-q, --quality RF
Constant quality (RF value, lower = better).-b, --vb kbps
Video bitrate in kbps.-r, --rate fps
Frame rate.-a, --audio tracks
Audio track(s) to include (comma-separated).-E, --aencoder codec
Audio encoder: copy, aac, ac3, mp3, opus, flac.-s, --subtitle tracks
Subtitle track(s) to include.--crop top:bottom:left:right
Crop values.-w, --width pixels
Output width.-l, --height pixels
Output height.--two-pass
Enable two-pass encoding.
CAVEATS
Cannot output to some patent-encumbered formats. DVD/Blu-ray decryption requires libdvdcss. Quality settings don't translate directly between encoders. Hardware encoding availability depends on GPU and drivers. Two-pass encoding doubles processing time.
HISTORY
HandBrake was originally created by Eric Petit (titer) in 2003 as "MediaFork" for BeOS, then renamed and continued on other platforms. The project was revived by the open-source community after a period of inactivity. It has become one of the most popular open-source video transcoders, known for its balance of features and usability.
