
HandBrake is the best-known free video converter, and its command-line version, HandBrakeCLI, is ideal for servers: no GUI to click through, easy to script, and perfect for converting whole folders overnight on a Windows VPS or dedicated server. This guide shows how to install HandBrakeCLI on Windows Server, the commands you'll use most, ready-to-use examples, and a PowerShell script for batch conversion.
Quick answer
HandBrakeCLI.exe -i "input.mkv" -o "output.mp4" --preset "Fast 1080p30"
That converts a video to MP4 (H.264 + AAC) with HandBrake's standard 1080p preset.
Step 1: Download and install HandBrakeCLI
- Go to the official site, handbrake.fr, open Downloads → Other → Command Line Version, and download the Windows x86_64 ZIP. (The current stable series is 1.11, released in 2026.)
- Extract it to a folder such as
C:\Tools\HandBrakeCLI. There's no installer;HandBrakeCLI.exeis self-contained. - Add the folder to the PATH so you can run it from anywhere:
Open a new PowerShell window afterwards.[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Tools\HandBrakeCLI", "Machine") - Check it works:
HandBrakeCLI.exe --version
If you use Chocolatey, choco install handbrake-cli does the same. Unlike the HandBrake GUI, the CLI doesn't need the .NET Desktop Runtime.
Step 2: Learn the basic options
| Option | What it does |
|---|---|
-i, --input | Source file (or DVD/Blu-ray folder) |
-o, --output | Output file; the extension sets the container (.mp4, .mkv, .webm) |
-Z, --preset | Use a built-in preset, e.g. "Fast 1080p30" |
-z, --preset-list | List all built-in presets |
-e, --encoder | Video encoder: x264, x265, svt_av1, nvenc_h264, qsv_h264 … |
-q, --quality | Constant quality (lower = better; ~20–23 for x264) |
-b, --vb | Average video bitrate in kbps (instead of -q) |
--encoder-preset | Speed vs size, e.g. veryfast, medium, slow |
-w, -l / --maxWidth | Width/height, or limit the maximum size |
-E, -B | Audio encoder and bitrate, e.g. -E av_aac -B 160 |
--all-audio, --all-subtitles | Keep every audio or subtitle track |
--start-at, --stop-at | Encode only part of the video |
See everything with HandBrakeCLI.exe --help.
Step 3: Useful HandBrakeCLI examples
Convert to MP4 with a preset
HandBrakeCLI -i "D:\Videos\talk.mkv" -o "D:\Out\talk.mp4" -Z "Fast 1080p30"
Smaller files with H.265
HandBrakeCLI -i in.mp4 -o out.mkv -e x265 -q 24 --encoder-preset medium -E av_aac -B 128
Resize to 720p for the web
HandBrakeCLI -i in.mov -o out.mp4 -e x264 -q 22 --maxWidth 1280 --maxHeight 720 --optimize
--optimize moves the MP4 index to the front so the video starts playing before it's fully downloaded.
Keep all audio and subtitle tracks
HandBrakeCLI -i movie.mkv -o movie-small.mkv -Z "H.265 MKV 1080p30" --all-audio --all-subtitles
Cut a clip
HandBrakeCLI -i in.mp4 -o clip.mp4 -Z "Fast 1080p30" --start-at seconds:60 --stop-at seconds:30
This starts at 1:00 and encodes 30 seconds.
Use a preset exported from the GUI
Create the perfect settings in the HandBrake GUI on your PC, choose Presets → Export, copy the JSON file to the server, then:
HandBrakeCLI --preset-import-file "C:\Tools\mypreset.json" -Z "My Preset" -i in.mkv -o out.mp4
Step 4: Batch convert a folder with PowerShell
$in = "D:\Videos\Incoming"
$out = "D:\Videos\Converted"
New-Item -ItemType Directory -Force -Path $out | Out-Null
Get-ChildItem $in -Include *.mkv,*.avi,*.mov -Recurse | ForEach-Object {
$target = Join-Path $out ($_.BaseName + ".mp4")
if (-not (Test-Path $target)) {
HandBrakeCLI -i $_.FullName -o $target -Z "Fast 1080p30" 2>&1 |
Out-File -Append "$out\handbrake.log"
}
}
The script skips files already converted and writes the encoder output to a log file. Save it as convert.ps1 and run it from Task Scheduler at night with powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\Tools\convert.ps1.
Performance tips for servers
- CPU encoders (x264, x265, SVT-AV1) use every core. On a VPS, a faster
--encoder-preset(veryfast,faster) cuts encoding time a lot for a small size increase. - Hardware encoders (
nvenc_h264/nvenc_h265,qsv_*,vce_*) are much faster but only work if the server has a supported GPU and driver. Most standard VPS plans don't, so use CPU encoders there. - Run one encode at a time per server; x264/x265 already use all cores, so parallel jobs only compete.
- Keep source and output on fast local disks, not network shares.
Frequently asked questions
Where do I download HandBrakeCLI for Windows?
From handbrake.fr → Downloads → Command Line Version. It's a ZIP file containing HandBrakeCLI.exe.
How do I list HandBrake presets from the command line?
Run HandBrakeCLI --preset-list (or -z).
Can HandBrakeCLI use my GPU?
Yes, with -e nvenc_h264, nvenc_h265, qsv_h264 or similar, if the computer has a supported NVIDIA, Intel or AMD GPU and current drivers.
Does HandBrakeCLI work on Windows Server?
Yes. It runs on Windows Server like any 64-bit console program and doesn't need the GUI or a logged-in desktop when started from Task Scheduler.


