libdvdread 7.1 & libdvdcss 1.6: the DVD-VR edition

libdvdread 7.1 & libdvdcss 1.6: the DVD-VR edition

Earlier this month, I released libdvdread 7.1.0 and libdvdcss 1.6.0, the latest versions of the open-source libraries powering DVD playback, as part of VideoLAN.

Last year, we brought DVD-Audio to the open DVD stack: parsing, navigation and decryption. This year, we go after the next forgotten corner of the format: DVD-VR, the recording format, and its CPRM protection.

These releases also continue the regular cadence I committed to for all our libraries, after dav1d 1.5.4 and libbluray 1.5.0. Security and OS updates need releases, not just green CI.

DVD-VR: the discs you recorded

DVD-Video is what the studios pressed, and was used everywhere; DVD-VR is what you recorded.

Standalone DVD recorders, quite popular in the 2000s, notably in Japan and Europe, used the DVD Video Recording format to record TV and camcorder footage onto DVD-RW, DVD-RAM and DVD-R. It is a genuinely different format: a DVD_RTAV directory instead of VIDEO_TS, different IFO structures, and it is editable: recorders let you cut commercials, reorder programs and build playlists directly on the disc.

Millions of those discs exist: family events, home videos, decades of TV archives. The recorders that made them are dying, the discs themselves are aging, and until now the open-source stack simply could not read them. If you care about media preservation, and I do, this is exactly the kind of content that disappears silently.

There was a second lock on top: broadcasts flagged copy-once, which means essentially all Japanese digital TV, are encrypted on the disc with CPRM. Even extracting the raw stream gave you garbage.

Both locks are now open.

libdvdread 7.1.0 adds:

  • Parsing of the DVD-VR IFO structures (PGIT, PG_GI, PS_GI), including the user-defined cells and time maps, i.e. the playlists and edits you made on the recorder;
  • New DVDOpenVideoRecording / DVDOpenStreamVideoRecording and ifoOpenVideoRecording APIs;
  • Auto-detection of the disc type: DVDOpen now probes for DVD-Video, DVD-Audio and DVD-VR, so players do not need to guess;
  • Hardened parsing of missing or malformed metadata, because real recorded discs are messy: power cuts mid-recording, half-finalized sessions, buggy recorder firmware.

A fun detail: there is no openly published DVD-VR specification, so this was implemented the hard way and by cross-referencing the patents against real discs. Some variables in the code are literally named after the patents.

CPRM: the third protection scheme

libdvdcss 1.6.0 adds decryption of CPRM (Content Protection for Recordable Media), the scheme protecting recordable DVD media.

This completes the set: CSS for DVD-Video since the very beginning, CPPM for DVD-Audio since last year, and now CPRM for recordable media.
Like CPPM, CPRM is built on the C2 cipher, but with a twist: each disc carries a unique media identifier alongside its Media Key Block, so the keys are per-disc, not per-title.

With three schemes in the library, applications needed a way to know which one they are facing. The new dvdcss_get_encryption_type() reads the disc’s Copyright Protection System Type and reports whether the media is unprotected, CSS/CPPM, or CPRM, so players can pick the right path before touching a single sector, instead of guessing from the directory layout.

This is also the release where last year’s CPPM code met reality. Testing on real discs exposed a series of rough edges in 1.5.0: the decryption cache could be torn down twice (it is now refcounted), the MKB parser could read past the end of its buffer, the copy-control handling used a wrong byte definition and cleared flags beyond the current block, and several error paths leaked memory or went unchecked. All fixed in 1.6.0, and dvdcpxm_setup() now allows context reuse and accepts a raw CPRM key in place of the MKB.

Cross-platform it is still: fixed CPRM ioctl paths on macOS and OS/2, improved Windows drive opening, FreeBSD build fixes, and proper Haiku support.

Last year I joked that we should maybe rename libdvdcss. It now decrypts three schemes, only one of which is CSS.
We are keeping the name anyway. :)

DVD-Audio still images: promise kept

In the DVD-Audio post, I wrote that still images were still missing. Done: libdvdread now parses the ASVS (Audio Still Video Set) structures, exposes the corresponding IFO, backup and menu VOB files, and improves the AOB/VOB stream type handling.

That last point fixes a subtle bug: the still-video and menu VOBs on a DVD-Audio disc are CPPM-protected, not CSS, but libdvdread assumed VOB means CSS and fed them to the wrong descrambler. Decryption is now routed per file, VIDEO_TS to CSS, AUDIO_TS to CPPM, and both can be active simultaneously, which is what hybrid discs need.

The rest

  • DVDOpenFiles lets applications provide their own virtual filesystem implementation, useful to read a DVD tree out of archives or non-standard storage;
  • The internal filesystem code was split into platform-specific helpers, with improved file and directory handling on Windows, macOS and iOS;
  • The usual batch of hardening: oversized still video groups, byte swapping of DVD-VR cell entry points, DVDFileSeek validation, partial-block size accounting, resource leaks and null pointer checks.

Everything is additive, so no ABI break this time. (A small 7.1.1 followed, fixing the exported symbols; package that one.)

No new libdvdnav either: DVD-VR discs have no interactive menus, so libdvdread is enough to play them.

What is next?

The VLC integration is in progress, and VLC’s dvdread module already learned about DVD-VR in master.

And we need testing, which for once means you: dig out the discs you or your parents recorded twenty years ago, especially the CPRM-protected ones, and tell us what breaks. This is the whole point.

With libbluray 1.5.0 released the same week, the whole open optical-disc stack got refreshed this month.

DVD is not dead! DVD stay alive, when the streaming services don’t!

Thanks

Most of this work was done by Saifelden Ismail, who started on DVD-Audio as a GSoC 2025 student and simply never left. This is GSoC working exactly as intended.

Thanks also to Steve Lhomme, Kacper Michajłow, KO Myung-Hun for OS/2, Jérôme Duval for Haiku, and everyone who contributed fixes and tested discs.

Patches welcome, as usual. :D