DVD ripping on Linux

User Rating:  / 0
PoorBest 
  1. Steps to copy and remove protections and encryptions from dvds
    1. The process:
      1. ddrescue -n -b2048 /dev/sr0 output.iso
        1. Step 1 copys the DVD to disk block by block but any bad sectors found zero data is filled in. At this point you are left with a DVD iso that has the copy protection removed but the encryption is still intact.
        2. ddrescue -n -b 2048 /dev/hdb ratatouille.iso ratatouille.log
        3. ddrescue -d -b 2048 -r 3 /dev/sr0 filename.iso filename.log
          1. goes over bad spots 3 times after getting all the good stuff first.
      2. k9copy
        1. optional do just downsize to a 4gb dvd at this point. Else go on
      3. dvdbackup -M -i output.iso -o dvd_structure
        1. Step 2 extract the contents to a directory. This second step leaves you with the structure of a dvd without the encryption. I want to preserve everything about the original DVD (except the copy protection and encryption) so I used the mirror option. This leaves me with all the features and original menus.
        2. dvdbackup -i ratatouille.iso -o . -M -n RATATOUILLE
      4. mkisofs -dvd-video -o clean_dvd.iso dvd_structure
        1. Step 3 take the DVD structure and pack it up into a nice ISO.
        2. to make the DVD fit on a single layer DVD (4.something GB). If you wanted to do that you should requantize after step 2
  2. This one will copy all the titles off a dvd into a single avi file
    1. mencoder -oac pcm -ovc copy /dev/sr1 -o test.avi
  3. copy the main movie off a dvd into one single vob container with no loss.
    1. vobcopy -i /dev/sr0/ -v -l
  4. vobcopy -I -i /dev/sr0
    1. print verbose information about the contents of a dvd
  5. find out information about a video file
    1. ffmpeg -i filename.flv
  6. this command will help you identify audio tracks aid subtitle tracks sid etc
    1. mplayer dvd://0 -frames 0 -identify
  7. This will play the dvd title 0 and track 128 to verify you got the right one.
    1. mplayer dvd://0 -aid 128
    2. mplayer dvd://0 -dvd-device /dev/dvd1 -aid 128
  8. Two pass encode of the first track a DVD to an MPEG-4 ("DivX") AVI while copying the audio track.
    mencoder dvd://1 -dvd-device /dev/dvd1 -aid 128 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o /dev/null mencoder dvd://1 -dvd-device /dev/dvd1 -aid 128 -ovc lavc -lavcopts vcodec=mpeg4:threads=2:mbd=2:trell:vpass=2 -oac copy -o output.avi
  9. This will extract audio track no. 128, downmix the AC3 sound to PCM and write the results to file.wav:
    1. mplayer -vo null -hardframedrop -aid 128 -ao pcm -aofile file.wav dvd://1
  10. Show all subtitles streams:
    1. mplayer -vo null -ao null -frames 0 -v 2 dvd://1 >&1 | grep sid
  11. First pass dvd rip... The set of commands was too long, so I had to separate them into two. This set of commands will rip a dvd title using a 2 pass mencoder xvid encode. It will provide a great quality rip. It will rip as close to 700MB as possible. (note the bitrate of -700000)
    1. mencoder dvd://<title> -dvd-device <device> -aid 128 -info srcform='ripped by mencoder' -oac mp3lame -lameopts abr:br=128 -ovc xvid -xvidencopts pass=1:chroma_opt:vhq=4:bvhq=1:quant_type=mpeg -vf pp=de,crop=0:0:0:0, -ofps 30000/1001 -o '/dev/null'
  12. Second pass dvd rip... The set of commands was too long, so I had to separate them into two. This set of commands will rip a dvd title using a 2 pass mencoder xvid encode. It will provide a great quality rip. It will rip as close to 700MB as possible. (note the bitrate of -700000)
    1. mencoder dvd://<title> -dvd-device <device> -aid 128 -info srcform='ripped by mencoder' -oac mp3lame -lameopts abr:br=128 -ovc xvid -xvidencopts pass=2:bitrate=-700000 -ofps 30000/1001 -o '<outputfile.avi>'
  13. Encode a SVCD to AVI file:
    1. mencoder -oac lavc -ovc lavc vcd://1> -o ./svcd.avi

How to take a directory full of .vob, .ifo and .bup files and make a dvd iso First, create VIDEO_TS and AUDIO_TS folders, if you don't already have them. Copy all .VOB, .IFO and .BUP files to VIDEO_TS folder and leave AUDIO_TS empty. To create ISO I used a mkisofs command like so:

  • mkisofs -dvd-video -o mydvd.iso -udf /path/to/filedir/

Where "mydvd.iso" is the name of my future ISO file and "/path/to/filedir/" is the directory containing my VIDEO_TS and AUDIO_TS folders. Just in case I checked to make sure that VIDEO_TS.IFO file had the lowest sector number:

  • isoinfo -i mydvd.iso -l