Skip to content

Instantly share code, notes, and snippets.

@adriankeenan
Created March 5, 2024 00:29
Show Gist options
  • Save adriankeenan/8e5c22429113acce57702b40c37a46f1 to your computer and use it in GitHub Desktop.
Save adriankeenan/8e5c22429113acce57702b40c37a46f1 to your computer and use it in GitHub Desktop.
Linux DVD to MKV

A script I've been using to rip and remux DVDs to MKVs.

What this does:

  • Create an output folder named after the DVD title and current timestamp (allowing sorting and multiple runs per DVD, if needed)
  • makemkv is used to dump each title in to a separate MKV
  • Eject the disc on completion
drive="/dev/sr0"
label=$(blkid -o value -s LABEL "$drive")
now=$(date +%s)
dvd_id="${now}-${label}"
echo ">>> Ripping $dvd_id from $drive"
mkdir "dvd/$dvd_id"
makemkvcon mkv "dev:$drive" all "dvd/$dvd_id"
eject "$drive"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment