libbluray 1.5.0

libbluray 1.5.0: UHD and BD-J

Almost a year ago, I wrote about the open source Blu-ray stack, with the releases of libbluray 1.4.0 and libudfread 1.2.0.
Today, we are releasing a new version: libbluray 1.5.0.

libbluray is the reference open-source library for Blu-ray playback. It is used by VLC, and many other players and tools, to read the disc structure, navigate the titles and playlists, and run the interactive menus.
And, as I said last time, with the growing limitations of the streaming platforms, playback of actual physical discs is key for the preservation of media.

Where 1.4.0 was mostly about the buildsystem and Java updates, 1.5.0 is mostly about features: it exposes much more of the disc metadata, notably for UHD discs, and it does a large amount of work on the interactive menus. It is also an ABI break.

Better metadata: HDR, Dolby Vision and chapters

Modern Blu-ray, and especially UHD Blu-ray, carry a lot of metadata that applications need in order to render the content correctly. Until now, a player using libbluray could open a disc and read its streams, but it had very little information about how those streams were meant to be displayed. 1.5.0 changes that, and exposes much more of it through the API:

  • The stream information now reports the dynamic range type, the colour space and an HDR10+ flag, alongside a conversion flag. This lets a player know whether a given stream is SDR, HDR10, HDR10+ or Dolby Vision, and select the right decoding and display path, instead of guessing or re-parsing the disc itself.
  • Dolby Vision tracks are now exposed as such, and the list_titles tool reports the number of Dolby Vision tracks per title. This makes it much easier to detect and select the DV presentation on discs that carry several variants.
  • Chapter names, present on some discs, are now exposed in the title information, so players can show human-readable chapter titles instead of just numbers.

This continues the UHD and HDR story I described in the 1.4.0 post, moving from “we can read the disc” to “we can tell you what is on it”.

BD-J: interactive menus

As I explained last time, Blu-ray menus rely on BD-J, a Java-based interactivity system. A large part of the 1.5.0 work targets the HAVI widget set, the UI toolkit that BD-J applications use to draw their menus on screen.

Many discs build their menus out of these HAVI components, and until now several of them were incomplete in libbluray, so the corresponding menus would not render or react correctly. This release fills a lot of those gaps:

  • Implementation of the HAVI look-and-feel for the text and graphic components, and of the navigable and actionable components. These are the building blocks of interactive menus: the buttons, icons and text widgets that display graphics and text, take focus, and react to the remote control.
  • Rendering fixes: disabled components are no longer hidden, and the vertical text alignment is now correct.
  • Faster startup, by loading the .bdjo title objects lazily, instead of parsing them all upfront.
  • Support for the S3D (stereoscopic 3D) and UHD stream types in the title metadata.

Together, these make more disc menus actually work, which is often the hardest part of Blu-ray playback.

An ABI break: libbluray.so.4

Unfortunately, 1.5.0 is an API and ABI breaking release. The public structures describing the streams, clips and titles gained new fields for all the metadata above, and one enumeration moved to a cleaner header. And this was hard to do in a compatible way.

libaacs 0.12

In the 1.4.0 post, I noted that libbluray does not perform the AACS nor the AACS2 decryption itself: that is the job of one of its companion libraries, libaacs. It got a release too: 0.12.0.

This is the first libaacs release since 2022, and it gathers the fixes accumulated over the years: several memory leaks, more robust error handling on unsupported AACS versions and on drive and MMC errors, and a macOS fix. It also adds a new aacs2_get_bdj_root_cert_hash() function and the possibility to override the configuration directory through the AACS_HOME environment variable. As these are backwards-compatible additions, its soname stays at libaacs.so.0.

Conclusion

libbluray 1.5.0 and libaacs 0.12.0 continue the effort to keep the open source Blu-ray stack alive and moving: exposing more of what the discs contain, making the menus work better, and keeping the whole stack building and running on modern systems.

You can find the full changelogs here:

The code is, as always, open source. Patches are welcome.