Linux command
handbrakecli 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Convert a video
HandBrakeCLI -i [input.mkv] -o [output.mp4] --preset="[Fast 1080p30]"
List available presets
HandBrakeCLI --preset-list
Convert with specific video codec
HandBrakeCLI -i [input.mkv] -o [output.mp4] -e [x264]
Set video quality
HandBrakeCLI -i [input.mkv] -o [output.mp4] -q [22]
Convert a DVD
HandBrakeCLI -i [/path/to/VIDEO_TS] -o [output.mp4] --preset="[Fast 1080p30]"
Extract a specific title
HandBrakeCLI -i [/dev/dvd] -t [1] -o [output.mp4]
Convert with audio and subtitle
HandBrakeCLI -i [input.mkv] -o [output.mp4] -a [1,2] -s [1]
Scan input
HandBrakeCLI -i [input.mkv] --scan
说明
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.
参数
- -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, nvenc_h264, nvenc_h265, vce_h264, vce_h265, 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.
FAQ
What is the handbrakecli command used for?
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.
How do I run a basic handbrakecli example?
Run `HandBrakeCLI -i [input.mkv] -o [output.mp4] --preset="[Fast 1080p30]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -i, --input _source_ do in handbrakecli?
Input file, directory, or device.