bluray_info - a set of utilities for accessing Blu-ray discs
Includes:
Requirements:
Building:
$ ./configure $ make $ make install
If you want to build bluray_player you will need libmpv (part of mpv package) installed on your system. Then, pass the build option to configure
$ ./configure --with-libmpv
Documentation:
More documentation online: https://github.com/beandog/bluray_info/wiki Each program also has its own man page.
Disc access:
Decrypting Blu-ray discs is done through libaacs. Even with libaacs, you will need a KEYDB.cfg file to bypass the encryption, and can be found various places online. The best location is http://fvonline-db.bplaced.net/
libaacs by default will look for KEYDB.cfg in ~/.config/aacs/ but with these utilities, you can specify the path directly if you'd like.
Sources:
The source can be either a device name, a single file, or a directory. The program will the default Blu-ray drive based on your OS if no path is given.
$ bluray_info $ bluray_info /dev/sr0 $ bluray_info ~/Media/BD.ADVENTURE.iso $ bluray_info ~/Media/BD.ADVENTURE/
If you're going to do a lot of reads on a disc drive, I'd recommend mounting it so the access can be cached -- this is especially helpful when using / testing bluray_copy a lot to get chapters, playlists, etc.
Playlists:
bluray_info uses libbluray to determine which playlist is the main one, and doesn't calculate it itself.
libbluray has two ways to display all playlists: there are 'relevant' ones where the library filters out any duplicates. However, the list of duplicates can change across locations, filesystems, systems, etc. For that reason, if you are using this to script something or need consistent output, always use the '--duplicates' option to display all of the playlists, and not filter any of them out.
bluray_info:
Usage: bluray_info [bluray path] [options]
See bluray_info --help for all options.
bluray_info syntax and output was designed to closely resemble the awesome program "lsdvd" (and later my own clone and other programs, from dvd_info).
It will display as much relevant information I can get from the disc that is provided by libbluray. Sadly, there's no way to display the number of channels for each audio stream right now, and so it will simply display the codec as Dolby Digital (ac3), DTS, etc.
bluray_copy:
Usage: bluray_copy [bluray path] [options]
See bluray_copy --help for all options.
Blu-rays can store many codecs, and its container is an MPEG-2 transport stream. If you so desire, you can easily remux it into another container -- and get the file much smaller by dropping audio tracks you don't want or need. I recommend using mkvmerge (from mkvtoolnix) or ffmpeg.
Two examples of remuxing the copied stream with only the first audio track:
$ mkvmerge -o bluray.mkv -a 1 bluray.m2ts
$ ffmpeg -i bluray.m2ts -map 0:0 -map 0:1 -codec copy bluray.mkv
Or you can use bluray_copy to output to stdout and remux on the fly:
$ bluray_copy -o - | ffmpeg -i - -map 0:0 -map 0:1 -codec copy bluray.mkv $ bluray_copy -o - | ffmpeg -i - -map 0:0 -map 0:1 -codec copy -f mpegts bluray.m2ts
Blu-rays can hold a lot of stuff ... a lot. bluray_copy won't do anything fancy like check to see if you have enough space to copy the title you want to, so be careful. It will simply quit if it can't write to the hard drive anymore.
If no argument is given, bluray_copy will simply select the main playlist.
The same notice is given here about 'duplicate' titles. Be sure to use the '--duplicates' option if you are using bluray_info output to list them. As a general rule, this option should be used with both programs -- it is the default to not to, as to stay consistent with 'ffmpeg' and 'mpv' projects.
bluray_player:
Since bluray_player uses libmpv as its backend, it can also use its configuration syntax for playback. See mpv's documentation for more details: https://mpv.io/manual/stable/#configuration-files
Your configuration file is read from ~/.config/bluray_player/mpv.conf
Support:
I love hunting down anomalies, so if you run into something odd on a disc, let me know and I'd love to look into it. Bug reports are good, too.
About Me:
I love working with multimedia on Linux! It's a lot of fun. I have done and do push a lot of my support and development into Gentoo Linux and that is where I could best provide support if you're hitting problems.
I have an old blog where I would write about my adventures in multimedia as well, so there may be some content there if you're willing to dig for it at https://wonkabar.org/ While the posts are old, the content is still relevant.
I'm a big fan of DVDs as well, and have a super big library of cartoons and other stuff (asking me what my favorite one is changes from week to week).
This project has been super fun to work on, my DVD utilities in the dvd_info github repo was the first time I'd ever gotten to learn and write code in C, and I love the programming language. It's a tough learning curve, but fun. I try really hard to do clean code and best practices, and my target is to have the binaries build with as little warnings as possible. I use clang -Weverything on my local development.
DVDs and Blu-rays are a lot of fun to work with. Optical media is not going away anytime soon, and there are always good reasons to prefer or rely on it: hobby collectors, no online requirements, save bandwidth, fun collections, guaranteed compatability, access to content, ability to archive, cool shelves to pack a display with, etc., etc.
I do a lot of work with encoding and multimedia in other areas, too, not just DVDs and Blu-rays. One of my favorite things is to find new devices that support video playback and then get things working on them! Good times. I'm a total multimedia geek.
In case someone is curious on my take about an HTPC setup, I use (and have used) and would recommend: Kodi, minidlna, and Plex. For hardware, I use an nVidia Shield. I also would recommend both the PS3 and the PS4 for excellent clients as well.
If you have questions, feel free to contact me at steve.dibb@gmail.com
Also, check out more information at https://dvds.beandog.org/
Copyright:
Licensed under GPL-2. See https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt