watching DVDs on an Apple iPad

By , on

Just for reference, here is a recipe about how to watch your DVDs on an Apple iPad. I have read that some of the required steps may be illegal to perform when you are in the USA (or an American citizen?); don't follow these instructions if you are not allowed to!

The instructions provided here use MPlayer/MEncoder on Ubuntu Linux to convert the DVD content into a file of the required format, but many other options are available.

  • Use lsdvd (contained in the Ubuntu package lsdvd) to find out which track of the DVD contains the actual movie. Normally this will be the longest track, lsdvd helpfully lists the index of this track at the bottom of its output.
    lsdvd
    
  • Use MPlayer (Ubuntu package mplayer) to verify that this is indeed the track you want:
    TRACKNO=1
    mplayer dvd://$TRACKNO
    

    You have to replace the value of TRACKNO with the track number found in the previous step.

  • Use mplayer to determine any cropping reqired:
    mplayer dvd://$TRACKNO -vf cropdetect
    

    This should print an option of the form -vf crop=720:430:0:48 to the console.

  • Use MEncoder to convert the data on the DVD to something an iPad will play. For the method described here, you need a version of mencoder with faac support included. One such version can be found in the Medibuntu repository.

    The call to mencoder requires about a million arguments. The following is inspired by a post at Mike McCandless' blog.

    CROP=720:430:0:48
    
    X264OPTS=crf=28:vbv_maxrate=1500:nocabac:global_header\
    :frameref=3:threads=auto:bframes=0:subq=6:mixed-refs=0\
    :weightb=0:8x8dct=1:me=umh:partitions=all:qp_step=4\
    :qcomp=0.7:trellis=1:direct_pred=auto
    
    FAACOPTS=br=160:mpeg=4:object=2:raw
    
    mencoder dvd://$TRACKNO \
      -of lavf -lavfopts format=mp4 \
      -vf crop=$CROP,pp=lb \
      -ovc x264 -x264encopts $X264OPTS \
      -oac faac -faacopts $FAACOPTS -channels 2 -srate 48000 \
      -o out.mp4
    

    You should replace the value of CROP with the value found in the previous step. This command can take a considerable amount of time to complete (comparable to the playing time of the DVD track), and should produce a big file out.mp4 (about 225MB per hour of playing time).

  • Copy the resulting file to a computer running Apple iTunes and add the file to your iTunes library. Finally, sync with your iPad.

Newer entry: playing with Google+
Older entry: new LaTeX package "jvlisting"

Back to blog