Rip a DVD on Linux with HandBrakeCLI: titles, tracks and output
A complete Linux CLI workflow: find the DVD, select the right title, check a sample and encode a playable file with deliberate audio and subtitle settings.
To rip a readable DVD on Linux with HandBrakeCLI, scan all titles, identify the recording you want, then encode that title to a new MP4 or MKV file. I recommend a short sample before the full encode: it catches a wrong episode, commentary track or subtitle choice while the job is still cheap to repeat. The current official x86_64 Linux Flatpak includes the command-line tool alongside the graphical app.
Use a disc or backup you have permission to copy. HandBrake opens unprotected discs and disc backups; it does not remove copy protection or DRM. A file made this way is a viewing copy, not a complete DVD archive with its menus.
1. Check the Linux CLI and available presets
The official CLI download page lists HandBrake 1.11.2 and confirms that the Linux CLI is included in the GUI Flatpak package. The current Flathub package targets x86_64. With Flatpak and Flathub already configured, the Linux installation instructions give this user installation command:
flatpak --user install fr.handbrake.ghb
If you use another architecture or need to set up Flatpak, follow that installation guide first. If a native HandBrakeCLI already works on your distribution, check its version and local help rather than installing a second copy automatically.
flatpak run --command=HandBrakeCLI fr.handbrake.ghb --version
flatpak run --command=HandBrakeCLI fr.handbrake.ghb --help
flatpak run --command=HandBrakeCLI fr.handbrake.ghb --preset-list
Throughout this guide, flatpak run --command=HandBrakeCLI fr.handbrake.ghb is the launcher. For a native CLI in your PATH, replace that entire prefix with HandBrakeCLI. Keep the capitalization. Options and available encoders can differ between builds; use the installed help to resolve a mismatch. Preset names are case-sensitive, so copy a name from your own preset list.
2. Find the DVD and scan every title
Insert the disc and identify its actual device path. lsblk can show device types, labels and mount locations:
lsblk --output NAME,TYPE,LABEL,MOUNTPOINTS
Match the optical drive to your disc. The examples use /dev/sr0; your device may differ. For an existing, complete and readable VIDEO_TS backup or DVD ISO, substitute its quoted path for the device. Open the whole source structure rather than guessing which individual VOB contains the recording.
flatpak run --command=HandBrakeCLI fr.handbrake.ghb \
--input "/dev/sr0" --title 0 --min-duration 0
This command scans; it does not encode. In the CLI source options, --title 0 scans all titles. --min-duration 0 includes short titles that the default ten-second threshold would skip. By contrast, --scan scans the selected title only. Adding it to a command with the default title 1 is not an all-titles scan.
Wait for the scan to finish. Read each candidate's title number, duration, chapters, dimensions, frame rate, audio tracks and subtitle tracks. If there are no valid titles, solve the source problem before changing output quality.
3. Choose the recording, not just the longest title
A title is a selectable recording or authored playback sequence. A chapter is a section inside that title. Neither is the same thing as an individual VOB file.
The longest title is a useful candidate for a single feature, but an episode DVD may have both separate episode titles and one long “play all” title. A recorder-made disc can contain several unrelated recordings. Do not assume title 1 is the feature, that every title is an episode, or that title numbers are consecutive episode numbers.

Use duration and track details to narrow the choice, then inspect the content. You can scan one candidate again without encoding; replace 2 with the number found on your disc:
flatpak run --command=HandBrakeCLI fr.handbrake.ghb \
--input "/dev/sr0" --title 2 --min-duration 0 --scan
If the content is ambiguous, the graphical DVD workflow makes visual title selection easier. Confirm the beginning and ending of the intended recording, not only its advertised duration. A “play all” title may duplicate the shorter recordings you also selected.
4. Encode a short sample with the intended settings
The following example assumes your scan identified title 2 and audio track 1, your intended player supports H.264/AAC stereo in MP4, and the source fits a 576-line, 25-fps limit. These are example choices, not detected properties of your disc. Replace the title, track, device and preset as needed. Choose an existing writable destination folder and a new filename; $HOME expands to your own home directory.
flatpak run --command=HandBrakeCLI fr.handbrake.ghb \
--input "/dev/sr0" --title 2 --min-duration 0 \
--preset "Fast 576p25" --format av_mp4 \
--audio 1 --subtitle none \
--start-at seconds:60 --stop-at seconds:30 \
--output "$HOME/Videos/dvd-title-2-sample.mp4"
This requests a 30-second sample starting 60 seconds into the selected title. CLI --stop-at is a duration relative to the start, not an absolute endpoint. Pick a start and duration that fit your recording; a short title needs different values. If you need a precise excerpt instead of a sample, see the distinction between GUI range endpoints and CLI durations.
Open the sample in the receiving player. Check dialogue, subtitle behavior, picture shape and motion. Sample a later section too if it has different lighting, movement or subtitles; the first quiet minute cannot establish how the rest will look.
The Fast 576p25 and Fast 480p30 presets use H.264 and AAC stereo. Their resolution and frame-rate numbers are maxima. Use the 480p30 choice for appropriate 480-line material up to 30 fps; do not pick a preset only because its number looks larger. Neither preset promises a fixed file size or preserves a surround soundtrack.
For a smaller file, compare another short sample after changing quality. With these x264 presets, a lower RF value means higher quality, usually with a larger file; it is not a quality percentage. Adding --quality 22 overrides the preset's quality value for a sample comparison, not a guaranteed target size. Do not transfer RF numbers blindly between encoders. When the output must fit a hard limit, use the duration and bitrate budget rather than assuming every DVD will become a 1 GB file.
The 1.11.2 SD presets include comb detection and Decomb. If a moving scene still shows combing, inspect the filter settings rather than forcing a higher frame rate. If the picture is stretched or cropped incorrectly, inspect dimensions, aspect ratio and crop before encoding again. The GUI can help inspect these choices; carry the intended preset and overrides into the CLI rather than assuming both apps have identical settings.
5. Encode the complete selected title
Once the sample is right, carry over its verified title, preset, quality, audio and subtitle choices. Remove both range options and choose a fresh full-length output filename. This example retains the original no-subtitle, audio-track-1 choices; replace them with any changes that made your sample correct:
flatpak run --command=HandBrakeCLI fr.handbrake.ghb \
--input "/dev/sr0" --title 2 --min-duration 0 \
--preset "Fast 576p25" --format av_mp4 \
--audio 1 --subtitle none --markers \
--output "$HOME/Videos/dvd-title-2.mp4"
Keep --scan out of this command, and replace --title 0 with your selected title. With no --chapters restriction, the CLI selects all chapters. --markers adds chapter markers; it does not recreate the DVD menu. To encode only verified chapters 2 through 4 instead, add --chapters 2-4 and use another output filename.
Keep the source available until the job finishes. HandBrake always converts the video: it has no video passthrough mode and does not create a complete DVD disc image. Keep the original or authorized backup when you need an archive.
Choose the wanted soundtrack explicitly
--audio 1 selects source audio track 1, which might be commentary or a language you do not want. Read the selected title's scan list. For a different numbered track, replace 1; for two identified tracks, a selection such as --audio 1,2 requests both. Check the resulting tracks, because the preset still controls how selected audio is encoded.
When language tags are reliable, replace the numeric selector with:
--audio-lang-list eng --first-audio
The language selectors use ISO 639-2 codes: eng for English and spa for Spanish. A list such as eng,spa with --first-audio chooses the first match per requested language. --all-audio requests all matches, potentially including commentary.
There is a fallback worth checking: if language selection finds no audio, 1.11.2 can fall back to the first track. Hearing sound does not prove an English track was found. Use a verified numbered track when tags are missing or several tracks share a language.
Choose one selection method. The CLI rejects numeric selectors combined with language or first/all selectors. When switching back to --audio 1, remove both --audio-lang-list and --first-audio or --all-audio.
Choose no subtitles, switchable subtitles or a burned track
The baseline commands deliberately use --subtitle none. Replace that option when subtitles are needed, after identifying the source track in the scan.
| Wanted result | Replace --subtitle none with | What to check |
|---|---|---|
| Switchable source track 3 | --subtitle 3 --subtitle-burned=none | Player supports DVD VobSub in the chosen container |
| Permanently visible source track 3 | --subtitle 3 --subtitle-burned=1 | Correct language and appearance; cannot be switched off |
| First English track, switchable | --subtitle-lang-list eng --first-subtitle --subtitle-burned=none | Wanted English track exists and player renders it |
Language selection can retain a preset's automatic foreign-audio search. Check for an extra forced-only track. Use the numbered selector when you need exactly one known source subtitle track.
Track 3 is an example, not a universal subtitle number. In --subtitle 3 --subtitle-burned=1, the burn number means the first item in the selected subtitle list; it does not mean source subtitle 1. As with audio, use either numbered subtitles or language selection, not both.
HandBrake 1.11.2 can pass DVD VobSub subtitles into MP4 and MKV. The receiving player must support that subtitle format in that container. MP4 video playback alone does not establish VobSub support.
Keep the explicit --subtitle-burned=none for switchable tracks: it disables the preset's DVD subtitle burn preference. Changing to MKV alone does not do that. If MKV suits your player better, use an appropriate preset such as "H.264 MKV 576p25" or "H.264 MKV 480p30", change the format to av_mkv and the filename extension to .mkv.
A default-subtitle flag controls automatic display, not burning. Forced-only selection also differs from selecting a full translated track: use it only when the disc's subtitle flags match the scenes you need. Verify an actual subtitled scene in the sample.
Several episodes or home recordings on one disc
Make a short mapping before encoding: source title number → actual recording → output filename. Verify each title rather than counting every scan entry as an episode. If one title is a complete “play all” sequence and other titles are the individual episodes, choose the representation you want to avoid duplicates.
Run the full command once per verified title, changing --title and --output together. Recheck audio and subtitle numbering for each title; the numbers need not describe the same language across the disc. For example, only after identifying them, title 2 could become episode-01.mp4 and title 4 could become episode-02.mp4. This is a naming example, not a proposed title map for your DVD.
If several episodes are inside one title, identify the correct chapter boundaries before using --chapters. Chapters may subdivide scenes rather than episodes, so one chapter per output is not a safe default. HandBrakeCLI's --json output can support a more deliberate script later; a grep count of human-readable scan lines is not a verified list of episode IDs.
I would keep the first disc's jobs sequential until title selection and playback are confirmed. A broad loop can efficiently encode the wrong sequence dozens of times. Do not add automatic deletion of source images or partial files while debugging.
If scanning or encoding fails
Preserve the complete log and identify the failing stage. To save both output streams from the scan, use a new log filename in a writable folder:
flatpak run --command=HandBrakeCLI fr.handbrake.ghb \
--input "/dev/sr0" --title 0 --min-duration 0 \
> "$HOME/Videos/dvd-scan.log" 2>&1
The terminal can appear quiet because messages go to that file. Shell redirections are evaluated from left to right: the order above sends standard output to the log, then standard error to the same destination. Keep that order. Remove the redirection to watch messages in the terminal again.
- Command not found or Flatpak app not installed: resolve the launcher and installation first. A native package and the Flatpak are separate installations.
- Cannot open the source: confirm the drive or complete backup path, disc readability and access permissions. The current package grants device and host-file access, but operating-system permissions or local overrides can differ. Do not use blanket
sudoencoding as the default fix. - No useful title or a tiny finished file: scan all titles and inspect duration and tracks. A successful encode of a zero-length or unwanted title is still the wrong result.
- Read or navigation errors: distinguish damaged media, mastering errors and unsupported protection from a preset error.
--no-dvdnavchanges the DVD reader; it does not remove protection. Repeatedly changing RF cannot repair unreadable source data. - Cannot create output, disk fills or job stops: check the exact destination, writable folder and free space. Treat the remaining file as partial until verified, and use a new filename for a retry.
- File finishes but the player rejects it: check the container, video codec, audio codec and subtitle format that player accepts. Match those before sacrificing picture quality.
Use the HandBrake error guide for the next diagnostic step. The DVD source guide explains the boundary between a readable source and a disc HandBrake cannot decode.
Verify the full file before calling it finished
Open the file at the exact destination path after the process exits. Compare its duration with the selected title, check the beginning and end, and seek through the middle. Listen for the intended soundtrack and synchronization. Switch retained subtitle tracks on and off; burned subtitles should remain visible in the picture.

Inspect a moving scene for combing, and faces or circles for distorted proportions. A sample that played correctly is useful evidence, but it does not prove the complete disc was read without a later error. Keep the original source and the job log until the full viewing copy passes these checks.


