#!/bin/bash MPLAYER="mplayer" if ! [ -b /dev/dvd ]; then echo "Usage: $0 [dvd-device] [folder]" exit 1 fi dvddevice="${1:-/dev/dvd}" folder="${2:-$(date +%Y-%m-%d_%H-%M)}" mkdir -p "$folder" cd "$folder" "$MPLAYER" 2> /dev/null \ -quiet -ao null -vo null -frames 0 -identify -dvd-device "$dvddevice" dvd:// | \ grep 'ID_DVD_TITLE_[0-9]*_LENGTH' | cut -d'_' -f4 | while read i do "$MPLAYER" -dumpstream -dumpfile "movie_${i}.mpg" -dvd-device "$dvddevice" dvd://"$i" done