Ripping the DVD to an MKV file
I suggest you use Handbrake (free, cross platform, open source) to rip the DVDs to an MKV file which contains everything.
Handbrake will already:
- Create an MKV file if you select MKV from Format under Output Settings
- Create an H.264-encoded video track of the titles you select from the DVD
- Create AAC-encoded audio tracks for all languages you select in the Audio tab
- Create soft-coded subtitles for all tracks you select in the Subtitles tab
Make sure you select Constant Quality for the video, and choose something between 18 and 28 for the quality. Lower means better, but you'll have to experiment on what looks good to you.
After you're done ripping, you can export the various tracks from the MKV file with FFmpeg. You can get a recent version by downloading a static build from the homepage. The static builds are always up-to-date, and if you're on Ubuntu, resist the temptation to use the one that comes with apt-get
: It's terribly outdated.
How the extraction works depends on how many audio and subtitle tracks your file has. To get this information later on, you can call ffmpeg -i input.mkv
and look at the output.
Here it says:
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, …
That's the video. Look further for audio—here are two audio tracks, one English, one German:
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, …
Stream #0:2(ger): Audio: aac (mp4a / 0x6134706D), 48000 Hz, …
Finally, you might see subtitles. Here, they're german:
Stream #0:3(ger): Subtitle: text (default)
Now, let's extract them…
Extract video only
First, we'll create an empty video with no audio or subtitles. Here, -an
disables the audio, and -sn
disables subtitles. Or leave out -sn
to keep the subtitles in.
ffmpeg -i input.mkv -c copy -an -sn output.mkv
Your output file will only contain video. You could also change the container here, if you want:
ffmpeg -i input.mkv -c copy -an -sn output.mp4
Extract audio only
This depends on how many audio tracks there are. To create separate audio files, we can do the following, assuming there are two audio tracks. Again, we'll disable video and subtitle output.
ffmpeg -i input.mkv \
-c:a:0 copy -vn -sn output-0.m4a
-c:a:1 copy -vn -sn output-1.m4a
As you can see, the index 0
and 1
specify the first and second audio tracks. If you have more, modify the command as needed and add another line.
Extract subtitles only
To get the subtitles, we'll follow a similar approach—assuming there is one subtitle track:
ffmpeg -i input.mkv -vn -an -c copy output.srt
Or, if there are multiple subtitle tracks:
ffmpeg -i input.mkv \
-c:s:0 copy -vn -an output-0.srt
-c:s:1 copy -vn -an output-1.srt
Best Answer
DVD Decrypter is about the best tool you can use to quickly rip an entire DVD to your hard drive and will keep all the structure (subtitles, menus, alternate languages et all) completely intact. It will also remove the copy protection.
About the only time it has a problem is with DVDs that are intentionally corrupted with bad sectors to prevent copying, sometimes it can just work slowly through the bad sectors, sometimes it can't. I've had several films come through this repairing unharmed and one which simply Does Not Work. These are the exception rather than the rule, most films rip fine.
After that you can do what you like with it, either keep it as a set of DVD files which you can then simply drop the
VIDEO.VOB
file into Windows Media Player to play it as a normal DVD (or you can associate the extension with WMP or $INSERT_FAVOURITE_PLAYER_HERE$).This does mean that you may be wasting quite a bit of space though and personally I convert my DVDs to mp4 video using Handbrake, which is another excellent free tool and saves a lot of space compared to raw DVD files.
As mentioned by Nifle Handbrake is a very full-featured encoder and supports various audio tracks and subtitles and, paired together with a player like VLC or MPC-HC, you can get all the joy of your DVD without all those annoying animated menus and "You're a Pirate" accusation screens that appear even though you actually bought the DVD.