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

1 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. Required fields are marked *