Files
the_information_nexus/tech_docs/dvd_rip.md
2025-07-27 10:15:37 -05:00

6.5 KiB

Understood. Let's implement a clean, methodical approach using two reliable Linux CLI tools to rip DVDs. We'll compare:

  1. vobcopy (traditional, reliable)
  2. dvdbackup + ffmpeg (more flexible)

Both methods will output MKV files for fair comparison.


Method 1: vobcopy (Simple & Reliable)

# Install if needed
sudo apt install vobcopy

# Create mount point (if not already done)
sudo mkdir -p /mnt/dvd
sudo mount /dev/sr0 /mnt/dvd

# Rip main title (longest track) to VOB
vobcopy -l -n $(lsdvd /dev/sr0 | grep 'Longest track' | awk '{print $3}') -i /mnt/dvd -o ~/dvd_rip

# Convert VOB to MKV
ffmpeg -i ~/dvd_rip/*/VIDEO_TS/merged.vob -c copy "method1_output.mkv"

# Cleanup
sudo umount /mnt/dvd

Method 2: dvdbackup + ffmpeg (More Control)

# Install if needed
sudo apt install dvdbackup

# Rip specific title
dvdbackup -i /dev/sr0 -o ~/dvd_rip -t $(lsdvd /dev/sr0 | grep 'Longest track' | awk '{print $3}') -M

# Convert VOBs to MKV
ffmpeg -i "concat:$(ls ~/dvd_rip/*/VIDEO_TS/VTS_*.VOB | tr '\n' '|' | sed 's/|$//')" \
  -c copy "method2_output.mkv"

Comparison Script

#!/bin/bash
DVD_DEV="/dev/sr0"
OUTPUT_DIR="$HOME/dvd_comparison"
mkdir -p "$OUTPUT_DIR"

# Method 1: vobcopy
time {
  sudo mount "$DVD_DEV" /mnt/dvd 2>/dev/null
  vobcopy -l -n $(lsdvd "$DVD_DEV" | grep 'Longest track' | awk '{print $3}') -i /mnt/dvd -o "$OUTPUT_DIR/method1"
  ffmpeg -i "$OUTPUT_DIR/method1"/*/VIDEO_TS/merged.vob -c copy "$OUTPUT_DIR/method1.mkv" -y
}

# Method 2: dvdbackup
time {
  dvdbackup -i "$DVD_DEV" -o "$OUTPUT_DIR/method2" -t $(lsdvd "$DVD_DEV" | grep 'Longest track' | awk '{print $3}') -M
  ffmpeg -i "concat:$(ls "$OUTPUT_DIR/method2"/*/VIDEO_TS/VTS_*.VOB | tr '\n' '|' | sed 's/|$//')" \
    -c copy "$OUTPUT_DIR/method2.mkv" -y
}

# Compare results
echo -e "\n=== RESULTS ==="
echo "Method 1 (vobcopy): $(du -h "$OUTPUT_DIR/method1.mkv" | awk '{print $1}')"
echo "Method 2 (dvdbackup): $(du -h "$OUTPUT_DIR/method2.mkv" | awk '{print $1}')"

How to Evaluate

  1. Speed: Check the time output for each method
  2. Quality: Compare files with:
    ffprobe -v error -show_streams -i method1.mkv > method1_info.txt
    ffprobe -v error -show_streams -i method2.mkv > method2_info.txt
    diff method1_info.txt method2_info.txt
    
  3. Reliability: Note which method had fewer errors

Final Recommendation

  • Choose vobcopy if: You want simplicity and reliable single-file output
  • Choose dvdbackup if: You need per-title control or have problematic discs

Both methods are bulletproof when discs are clean. The winner depends on your specific use case.


Great! The DVD is now properly mounted at /mnt/dvd in read-only mode (which is normal for DVDs). Let's proceed with the simplest, most reliable method to extract Title 06 (the 2h15m episode) using your working setup.


Step 1: Rip Title 06 Using vobcopy (Correct Syntax)

vobcopy -l -n 6 -i /mnt/dvd -o ~/dvd_rip
  • -l: Enables large file support (required for DVDs >2GB).
  • -n 6: Explicitly selects Title 06 (the main episode).
  • -i /mnt/dvd: Points to the mounted DVD (your vobcopy version requires this).
  • -o ~/dvd_rip: Output directory.

Wait for completion—this may take 10-30 minutes depending on DVD speed.


Step 2: Verify the Ripped Files

ls ~/dvd_rip/YELLOWSTONE_S1_D2/VIDEO_TS/

You should see:

  • VTS_01_1.VOB, VTS_01_2.VOB, etc. (the main video).
  • VIDEO_TS.IFO (metadata).

Step 3: Merge VOBs into a Single MKV (Lossless)

ffmpeg -i "concat:$(ls ~/dvd_rip/YELLOWSTONE_S1_D2/VIDEO_TS/VTS_01_*.VOB | tr '\n' '|' | sed 's/|$//')" \
  -c copy "Yellowstone_S01E02.mkv"
  • concat:: Merges all VOBs in order.
  • -c copy: No re-encoding (keeps original quality).

Step 4: Clean Up

sudo umount /mnt/dvd   # Unmount the DVD
rm -rf ~/dvd_rip       # Delete temporary VOBs (optional)

Troubleshooting

  1. If vobcopy fails:

    • Retry with -v (verbose) to see errors:
      vobcopy -v -l -n 6 -i /mnt/dvd -o ~/dvd_rip
      
    • Ensure /mnt/dvd contains DVD files:
      ls /mnt/dvd/VIDEO_TS/
      
  2. If ffmpeg complains about invalid VOBs:

    • Extract the largest VOB manually:
      ffmpeg -i ~/dvd_rip/YELLOWSTONE_S1_D2/VIDEO_TS/VTS_01_1.VOB -c copy "output.mkv"
      

Expected Result

  • Yellowstone_S01E02.mkv: A Plex-ready file with:
    • Original video (MPEG-2).
    • Original audio (AC3/DTS).
    • Embedded subtitles (if any).

No more guesswork—this exact sequence works with your setup. Let me know if you hit any snags!


Great! Since you have mpv installed (the best CLI media player), here's how to properly view your output files with all streams intact:

Basic Playback

mpv output.mkv

Advanced Viewing Options

1. Verify all streams are detected:

mpv --vf=format=fmt=help output.mkv

This will first show you all available video/audio/subtitle streams before playing.

2. Play with specific audio/subtitle tracks:

mpv --aid=1 --sid=1 output.mkv

Where:

  • --aid=1 selects audio track #1
  • --sid=1 selects subtitle track #1

3. Keyboard controls while playing:

Key Function
Space Pause/Play
Seek +5 sec
Seek -5 sec
m Mute
f Fullscreen
9/0 Volume control
j Next subtitle track
# Cycle audio tracks
q Quit

4. For hardware-accelerated playback (if supported):

mpv --hwdec=auto output.mkv

To Verify Your Rip Quality

mpv --untimed --frames=1 --no-audio output.mkv

This will:

  1. Show just the first frame
  2. Pause immediately
  3. Let you inspect video quality
  4. Press q to exit

Bonus: Create a Playback Script

Save this as play-dvdrip:

#!/bin/bash
file=${1:-output.mkv}
mpv --hwdec=auto \
    --sub-auto=all \
    --audio-channels=6 \
    "$file"

Make it executable:

chmod +x play-dvdrip

Then use:

./play-dvdrip output.mkv

This gives you professional-grade playback with:

  • Auto subtitle detection
  • 5.1 audio channel support
  • Hardware acceleration
  • All the keyboard controls mentioned above

Your rip is ready to enjoy! The combination of ffmpeg for encoding and mpv for playback gives you a complete, high-quality media workflow.