Miskatonic University Press

Ripping DVDs with ffmpeg

unix

For my future reference, here’s how I converted one video on a DVD into a better format. The video was family home video shot in 1994 on a camcorder and had later been digitized and put on DVD, but I wanted to get it off that and into a more modern, compressed format. I knew ffmpeg would do it, but I find video files confusing and didn’t know how.

When the DVD is mounted as data there’s just a VIDEO_TS directory in it

drwxr-xr-x 2 wtd wtd 4096 May 10 18:46 VIDEO_TS/

Inside that there were a few files. The VOB files are the actual video and the marvellous VLC will of course play them.

-rw-r--r-- 1 wtd wtd      12288 Dec 31  2005 VIDEO_TS.BUP
-rw-r--r-- 1 wtd wtd      12288 Dec 31  2005 VIDEO_TS.IFO
-rw-r--r-- 1 wtd wtd      30720 Dec 31  2005 VIDEO_TS.VOB
-rw-r--r-- 1 wtd wtd      40960 Dec 31  2005 VTS_01_0.BUP
-rw-r--r-- 1 wtd wtd      40960 Dec 31  2005 VTS_01_0.IFO
-rw-r--r-- 1 wtd wtd 1073739776 Dec 31  2005 VTS_01_1.VOB
-rw-r--r-- 1 wtd wtd  549941248 Dec 31  2005 VTS_01_2.VOB

The video is split into two files because there’s a maximum file size of 1 GB, so anything larger is divided up into multiple files. Thanks to the inevitable helpful answer on StackOverflow and some other Stack Overflow stuff, I got this going to concatenate the files and compress them with H.265 into smaller MP4 video files. (If there are more VOB files they can be added by extending the concat directive.)

ffmpeg -i "concat:VTS_01_1.VOB|VTS_01_2.VOB" -vcodec libx265 new-video-h265.mp4

This processed the video in more or less real time (about an hour), but it was on an old box. The result:

-rw-r--r-- 1 wtd wtd  304841184 May 10 19:34 new-video-h265.mp4

That’s 1.5 GB down to 290 MB, or about 80% reduction in file size. It looks just it like it did when we first watched it on the VCR.

Finally, whenever I think of old video, I always turn to The Gerry Todd Show.