DVD to mp4 (h264) conversion

Following on on from what’s becoming a mini series on data archiving from the Linux command line, I want to talk about backing up DVD’s via the command line. I’m not going to insult your intelligence with the lecture about copying copyrighted material so let’s get to it.

The command to use is dvdbackup and from the package description “Description: tool to rip DVD’s from the command line.  dvdbackup will extract all (or optionally only selected) titles as found on the dvd.  It will structure the extracted files in format suitable for burning at a later time with genisoimage and dvdrecord.  Has the advantage of being very easy to use, small, and fast.”. I just use it to dump the entire DVD onto the hard disk.

dvdbackup -Mv

From there you can encode the movie to MP4 format. I looked into a lot of encoding options and spent a lot of time trying to tweak the best options for video size versus quality. In the end I’ve found that the quality of the video produced following the ffmpeg settings on the gentoo forum are superb.

cat VTS_01_1.VOB  VTS_01_2.VOB  VTS_01_3.VOB | \
ffmpeg \
-map 0:0 -map 0:1 \
-i - \
-threads 2 \
-b 604k \
-vcodec h264 \
-ac 1 \
-ab 256k \
-ar 44100 \
-acodec mpeg4aac \
-coder 1 \
-flags +loop \
-cmp +chroma \
-partitions +parti4x4+partp8x8+partb8x8 \
-me hex \
-subq 5 \
-me_range 16 \
-g 250 \
-keyint_min 25 \
-sc_threshold 40 \
-i_qfactor 0.71 \
-vol 500 \
my-wedding-video.mp4

I did get an error about “Codec type mismatch” but following a post on the YouMakeMedia blog I changed the settings to:

cat VTS_01_1.VOB  VTS_01_2.VOB  VTS_01_3.VOB | \
ffmpeg -i - \
-threads 2 \
-b 604k \
-vcodec h264 \
-ac 1 \
-ab 256k \
-ar 44100 \
-acodec mpeg4aac \
-coder 1 \
-flags +loop \
-cmp +chroma \
-partitions +parti4x4+partp8x8+partb8x8 \
-me hex \
-subq 5 \
-me_range 16 \
-g 250 \
-keyint_min 25 \
-sc_threshold 40 \
-i_qfactor 0.71 \
-vol 500
my-wedding-video.mp4
This entry was posted in General and tagged . Bookmark the permalink.

One Response to DVD to mp4 (h264) conversion

  1. Pingback: Taking screenshots of your home movies « kenfallon.com

Leave a Reply

Your email address will not be published.