As I don’t care for the noise of an optical drive while going to sleep, have been transcoding a few favorite DVDs to USB sticks.
ffmpeg
is a versatile tool, but does not support import directly from DVD media.
mplayer
does however, and can stream dump.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #!/bin/bash function dvdrip { mplayer dvd://${1} -chapter ${2} -dumpstream # adjust as needed ffmpeg -i stream.dump -c:a aac -b:a 128k -c:v libx264 -crf 16 -pix_fmt yuv420p -f mp4 "${3}.mp4" rm stream.dump -f } case $(lsdvd -c | md5sum | cut -b-6) in # [...] # archer 5-1 da7c42) dvdrip 2 1-5 '0501 White Elephants' dvdrip 2 6-10 '0502 A Kiss While Dying' dvdrip 2 11-15 '0503 A Debt of Honor' dvdrip 2 16-20 '0504 House Call' dvdrip 2 21-25 '0505 Southbound and Down' dvdrip 2 26-30 '0506 Baby Shower' dvdrip 2 31-35 '0507 Smugglers Blues' ;; # default handler *) echo 'add config for:' lsdvd -c | md5sum | cut -b-6 esac eject |
-ac 2
to force it.