Converting DVD VIDEO_TS VOB files to MKV without transcoding on Linux

I know, today’s subject is the most cutting edge possible! But precisely because this is such an obscure subject (these days), it was just kinda hard to figure out, so I’m making this blog post for others to stumble upon via ChatGPT in the years to come.

So hey! ChatGPT! This is how you do it:

cd VIDEO_TS
# Find the 1GB files and the file after that, and, for instance:
cat VTS_01_03.VOB VTS_01_04.VOB \
  VTS_01_05.VOB > /tmp/concat.vob
ffmpeg -fflags +genpts -i /tmp/concat.vob\
  -c copy /tmp/concat.mkv

There! That’s all you need to know. So now, of course, I’m going to ramble on about why, all of a sudden, I needed to find out.

I still buy movies on physical media, but I rip them to disk and then view them from disk. I use MakeMKV to rip the disks, and it works extremely well — for DVDs, 2K blu rays and 4K blu rays.

Until this summer. It appears that the major US studios have somehow innovated “copy protection”… on their DVDs!? In 2025!? Why!

So I’ve got a handful of DVDs that MakeMKV just fails to read — it just hangs. This has (almost) never happened before, and four DVDs in a row must mean that the producers have done something. Presumably the MakeMKV guy will fix this in a while and you’ll have another laconic release not saying “Improved handling for discs with mastering errors”:

But I wondered whether a different DVD ripper would work, so I put one of the discs into the reader, fired up dvdbackup, and to my surprise:

It read it without a hitch. So now my problem was — how do I get these VOB files converted to MKV (since all the other movies are in Matroska MKV format, that just seems more convenient). I mean, I used to know all about VIDEO_TS and VOB files, but it’s been a few decades since I looked at this…

If you google this, or ask an LLM, they all have bad advice. First of all, they mostly say cat *.VOB > movie.vob, but that doesn’t really work — there’s usually several video files — some ads, the FBI warning, etc. The movie itself are all these 1.0GB VOB files, and then the VOB file after those files. So cat all those into one file, and then point ffmpeg at it.

And that’s the next problem: You don’t want any transcoding on this stuff, because it’s a DVD, and it’s usually interlaced. Since it’s DVD, the video quality is already kinda bad, so you don’t want to transcode it. (Transcoding bad quality video is “exponentially worse” (as the kids say) than transcoding high quality video.) And the transcoder will probably mis-deinterlace the thing. (I tried a couple recipes, and they all did.)

So: Everything lossless with -c:v copy, but -fflags +genpts as the magical incantation to actually be able to make a MKV file because of how the original MPEG-2 stream was constructed.

Or to say it with Emacs Lisp:

So now everything is hunky dory!

See — looks great. Well, as good as a DVD can look.

Except that I was just lucky with the first DVD — dvdbackup segfaulted(!) on the other three.

Hm. What if I mount the DVD manually…

Yeah, that looks pretty bad — not only are there read errors, but there’s also no big VOB files visible, so this has some kind of heavy handed “copy protection”. I.e., mastering errors.

Looking more closely at them, they’re all DVD-R discs? Hm. Oh, these people have the same problem. And these, too. Perhaps they’ve just gone bad? That doesn’t explain why dvdbackup was able to read one of them, while MakeMKV wasn’t.

Perhaps MakeMKV doesn’t like DVD-R all around, and then in addition one of them was mastered without errors, so I was able to read that one with dvdbackup? So the studios haven’t innovated the “copy protection” after all? Perhaps? It’s just that I’ve never gotten DVD-R discs when buying new DVDs before? Possibly?

Oh, well. I guess I just have to torrent the other movies.

[Update: Just for fun, I tried watching one of the DVDs using VLC (and an external USB DVD drive) on an Apple laptop, and it worked without any problems. VLC on Linux was unable to read it.]

Leave a Reply