libmmbd integration with mpv

The place to discuss linux version of MakeMKV
Post Reply
artim
Posts: 5
Joined: Wed May 20, 2026 9:08 am

libmmbd integration with mpv

Post by artim »

Hey, has anybody managed to successfully integrate mpv with libmmbd (on Linux)? I've compiled v1.18.3 from source and installed it (and activated it). But trying to get mpv to load it fails. I've enabled debug logs in the MakeMKV GUI and they do show entries when trying to access a UHD BD via mpv, but the content isn't too helpful:

Code: Select all

Debug log started at Sat May 16 18:40:32 2026 , written by MakeMKV v1.18.3 linux(x64-release)
001005:0000 MakeMKV v1.18.3 linux(x64-release) started
001004:0000 Debug logging enabled, log will be saved as file:///home/user/MakeMKV_log.txt
Using 768KB for read cache.
Network access is ENABLED, CURL version 8.20.0/OpenSSL/3.6.2/1.69.0 (x86_64-pc-linux-gnu) , proxy server not set.
001003:0020 DEBUG: Code 0 at `BLLaJX7%0; ?J)zOB:`KC:29393631
SDF  v0a5: HL-DT-ST_BD-RE_BU40N_1.03_211810241934_MOBP9KB3601
SDF  v0a5: HL-DT-ST_BD-RE_BU40N_1.03_211810241934_MOBP9KB3601
001011:0000 Using LibreDrive mode (v06.3 id=866A98CB9C4E)
003007:0000 Using direct disc access mode
DEBUG: Code 2147483648 at S{\1-j6N>Jamw4_#:121265499
DISCID=EF417B6B88914B8EE91D49A4249D0E52B7007FC6
005011:0000 Operation successfully completed
001003:0020 DEBUG: Code 0 at s=7}dcV.P\=%4H*o:213141852
001003:0020 DEBUG: Code 0 at s=7}dcV.P\=%4H*o:213141852
Application exited at Sat May 16 18:40:42 2026 
So accessing the drive isn't an issue, and MakeMKV can also access it and copy the content without any issues whatsoever. Also, VLC doesn't seem to have any issues with the integration.

This is how I try to integrate mpv with libmmbd (as there is no option to add entries in the integration settings of MakeMKV) and what mpv logs say:

Code: Select all

LIBAACS_PATH=/usr/lib/libmmbd LIBBDPLUS_PATH=/usr/lib/libmmbd mpv --bluray-device=/dev/sr0 bd://
[bd] List of available titles:
[bd] idx:   0 duration: 00:00:25 angles:  1 (playlist: 00000.mpls)
[bd] idx:   1 duration: 00:00:14 angles:  1 (playlist: 00004.mpls)
[bd] idx:   2 duration: 01:28:10 angles:  1 (playlist: 00002.mpls)
[bd] idx:   3 duration: 00:00:06 angles:  1 (playlist: 00001.mpls)
aacs.c:255: Unable decrypt unit (AACS)!
bluray.c:786: Skipping broken unit at 0
aacs.c:255: Unable decrypt unit (AACS)!
bluray.c:786: Skipping broken unit at 6144
Failed to recognize file format.
Exiting... (Errors when loading file)
And for reference, this is a MakeMKV log of a successful copying of a track from that same UHD BD:

Code: Select all

Debug log started at Mon May 18 14:56:56 2026 , written by MakeMKV v1.18.3 linux(x64-release)
001005:0000 MakeMKV v1.18.3 linux(x64-release) started
001004:0000 Debug logging enabled, log will be saved as file:///home/user/MakeMKV_log.txt
Using 262272KB for read cache.
Network access is ENABLED, CURL version 8.20.0/OpenSSL/3.6.2/1.69.0 (x86_64-pc-linux-gnu) , proxy server not set.
001003:0020 DEBUG: Code 0 at `BLLaJX7%0; ?J)zOB:`KC:29393631
SDF  v0a5: HL-DT-ST_BD-RE_BU40N_1.03_211810241934_MOBP9KB3601
SDF  v0a5: HL-DT-ST_BD-RE_BU40N_1.03_211810241934_MOBP9KB3601
001003:0020 DEBUG: Code 0 at `BLLaJX7%0; ?J)zOB:`KC:29393631
001003:0020 DEBUG: Code 100941312 at Gj,<<FB's&zxt`JC:121271617
001003:0020 DEBUG: Code 100941312 at SG^),l1LQ6MK6L>m:213130559
SDF  v0a5: HL-DT-ST_BD-RE_BU40N_1.03_211810241934_MOBP9KB3601
001011:0000 Using LibreDrive mode (v06.3 id=866A98CB9C4E)
003007:0000 Using direct disc access mode
005085:0000 Loaded content hash table, will verify integrity of M2TS files.
DEBUG: Code 2147483648 at S{\1-j6N>Jamw4_#:121265499
DISCID=EF417B6B88914B8EE91D49A4249D0E52B7007FC6
003307:0000 File 00003.mpls was added as title #0
003307:0000 File 00002.mpls was added as title #1
003307:0000 File 00001.m2ts was added as title #2
003307:0000 File 00000.m2ts was added as title #3
003307:0000 File 00005.m2ts was added as title #4
005011:0000 Operation successfully completed
005014:0000 Saving 1 titles into directory file:///home/user/Videos
AV sync issues in /home/user/Videos/title_t00.mkv
AV sync in 1,2 at 0:00:39 (8ms) : encountered overlapping frame, audio skew is +8ms
004047:0010 AV sync issue in stream 4 at 0:00:00 : Forced subtitles track #4 turned out to be empty and was removed from output file
004047:0010 AV sync issue in stream 6 at 0:00:00 : Forced subtitles track #6 turned out to be empty and was removed from output file
005005:0080 1 titles saved
005036:0104 Copy complete. 1 titles saved.
MrPenguin
Posts: 1885
Joined: Thu Oct 19, 2023 11:31 pm

Re: libmmbd integration with mpv

Post by MrPenguin »

artim wrote:
Wed May 20, 2026 9:34 am
Hey, has anybody managed to successfully integrate mpv with libmmbd (on Linux)? I've compiled v1.18.3 from source and installed it (and activated it). But trying to get mpv to load it fails. I've enabled debug logs in the MakeMKV GUI and they do show entries when trying to access a UHD BD via mpv, but the content isn't too helpful:
IIRC, libbluray should find and load libmmbd.so automatically. Have you installed libmmbd.so.0 in /usr/lib64, and can your user-id "see" it? E.g. check libmmbd.so.0 file ownership and permissions?
artim
Posts: 5
Joined: Wed May 20, 2026 9:08 am

Re: libmmbd integration with mpv

Post by artim »

libmmbd.so.0 is located in /usr/lib, not /usr/lib64. The only thing located in lib64 is a ld-linux-x86-64.so.2 symlink to ../lib/x86_64-linux-gnu/ld-linux-x86-64.so.2. libmmbd.so.0 is owned by root with 644 permissions, like every library in that directory.
MrPenguin
Posts: 1885
Joined: Thu Oct 19, 2023 11:31 pm

Re: libmmbd integration with mpv

Post by MrPenguin »

artim wrote:
Thu May 21, 2026 9:26 am
libmmbd.so.0 is located in /usr/lib, not /usr/lib64. The only thing located in lib64 is a ld-linux-x86-64.so.2 symlink to ../lib/x86_64-linux-gnu/ld-linux-x86-64.so.2. libmmbd.so.0 is owned by root with 644 permissions, like every library in that directory.
I think you are probably over-thinking this. FWIW, my own MakeMKV installation copies libmmd.so.0 into /usr/lib64, and IIRC libbluray would load it in preference to libaacs.so.0 from there without any further help from me. However:

Code: Select all

LIBAACS_PATH=/usr/lib64/libmmbd mpv --bluray-device=/path/to/backup/DOGMA/ bd://0
is correctly using libmmbd instead of libaacs.

Note that I am playing a disk backup here. I don't recommend trying to play a UHD disk directly, if only to save wear and tear on your UHD drive.
artim
Posts: 5
Joined: Wed May 20, 2026 9:08 am

Re: libmmbd integration with mpv

Post by artim »

As expected, even after copying libmmbd.so.0 to /usr/lib64/ I get exactly the same results. I would have been very surprised if that worked, as make install most likely knows where libbluray expects libmmbd to be located.

FYIW, that's what MakeMKV has to say about the disk:

Code: Select all

Drive Information
OS device name: /dev/sr0
Current profile: BD-ROM
Manufacturer: HL-DT-ST
Product: BD-RE BU40N
Revision: 1.03
Serial number: MOBP9KB3601
Firmware date: 2118-10-24 19:34
Bus encryption flags: 17
Highest AACS version: 82

LibreDrive Information
Status: Enabled
Drive platform: MT1959
Firmware type: Patched (microcode access re-enabled)
Firmware version: 1.03
DVD all regions: Yes
BD raw data read: Yes
BD raw metadata read: Yes
Unrestricted read speed: Yes

Disc Information
Label: UHD_KANU
Timestamp: 2025-11-21 19:49:46
Protection: AACS2.0/C v82
Data capacity: 59.41 Gb
Disc type: BD-ROM UHD
Number of layers: 2
Bus encryption flags: 80
MrPenguin
Posts: 1885
Joined: Thu Oct 19, 2023 11:31 pm

Re: libmmbd integration with mpv

Post by MrPenguin »

artim wrote:
Fri May 22, 2026 1:40 pm
As expected, even after copying libmmbd.so.0 to /usr/lib64/ I get exactly the same results. I would have been very surprised if that worked, as make install most likely knows where libbluray expects libmmbd to be located.
Curiously, MakeMKV chose to install libmmbd.so.0 in /usr/lib64 on my system:

Code: Select all

...
prefix=/usr
exec_prefix=${prefix}
datarootdir=${prefix}/share
libdir=${exec_prefix}/lib64
bindir=${exec_prefix}/bin
...
But regardless, I also successfully used the LIBAACS_PATH variable to tell mpv and libbluray to use libmmbd.so.0, which makes its actual installation directory moot.

Why are you including

Code: Select all

LIBBDPLUS_PATH=/usr/lib/libmmbd
for a UHD disk? BD+ is only used by a small number of standard BDs, and there hasn't been a new BD+ disk for years. No UHD disk uses BD+.
artim
Posts: 5
Joined: Wed May 20, 2026 9:08 am

Re: libmmbd integration with mpv

Post by artim »

MrPenguin wrote:
Fri May 22, 2026 7:31 pm
artim wrote:
Fri May 22, 2026 1:40 pm
As expected, even after copying libmmbd.so.0 to /usr/lib64/ I get exactly the same results. I would have been very surprised if that worked, as make install most likely knows where libbluray expects libmmbd to be located.
Curiously, MakeMKV chose to install libmmbd.so.0 in /usr/lib64 on my system:

Code: Select all

...
prefix=/usr
exec_prefix=${prefix}
datarootdir=${prefix}/share
libdir=${exec_prefix}/lib64
bindir=${exec_prefix}/bin
...
The Makefile is being created by configure. So for me it creates it with

Code: Select all

prefix=/usr
exec_prefix=${prefix}
datarootdir=${prefix}/share
libdir=${exec_prefix}/lib
bindir=${exec_prefix}/bin
datadir=${datarootdir}
But regardless, I also successfully used the LIBAACS_PATH variable to tell mpv and libbluray to use libmmbd.so.0, which makes its actual installation directory moot.
Exactly why I said that this doesn't make much sense to even try. Again, it does work when using VLC, which should just use the same architecture as mpv for this. I'll look into compiling mpv from scratch, maybe Debian did some configuration error that somehow prevents this from working.
Why are you including

Code: Select all

LIBBDPLUS_PATH=/usr/lib/libmmbd
for a UHD disk? BD+ is only used by a small number of standard BDs, and there hasn't been a new BD+ disk for years. No UHD disk uses BD+.
Because the LIBAACS_PATH variable didn't work on its own so I thought trying it together with the LIBBDPLUS_PATH variable can't hurt.

EDIT: also no success with self-compiled mpv (with -Dlibbluray=enabled set). What mpv version do you use? I have this:

Code: Select all

mpv --version
mpv v0.41.0 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.360.1
FFmpeg version: 8.0.1-3+b1 (runtime 8.1.1-3)
FFmpeg library versions:
   libavcodec      62.11.100 (runtime 62.28.101)
   libavdevice     62.1.100 (runtime 62.3.101)
   libavfilter     11.4.100 (runtime 11.14.101)
   libavformat     62.3.100 (runtime 62.12.101)
   libavutil       60.8.100 (runtime 60.26.101)
   libswresample   6.1.100 (runtime 6.3.101)
   libswscale      9.1.100 (runtime 9.5.101)
MrPenguin
Posts: 1885
Joined: Thu Oct 19, 2023 11:31 pm

Re: libmmbd integration with mpv

Post by MrPenguin »

artim wrote:
Sat May 23, 2026 8:30 am
What mpv version do you use? I have this:

Code: Select all

mpv --version
mpv v0.41.0 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.360.1
FFmpeg version: 8.0.1-3+b1 (runtime 8.1.1-3)
FFmpeg library versions:
   libavcodec      62.11.100 (runtime 62.28.101)
   libavdevice     62.1.100 (runtime 62.3.101)
   libavfilter     11.4.100 (runtime 11.14.101)
   libavformat     62.3.100 (runtime 62.12.101)
   libavutil       60.8.100 (runtime 60.26.101)
   libswresample   6.1.100 (runtime 6.3.101)
   libswscale      9.1.100 (runtime 9.5.101)

Code: Select all

$ mpv --version
mpv v0.40.0 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.351.0
FFmpeg version: 7.1.1 (runtime 7.1.4)
FFmpeg library versions:
   libavcodec      61.19.101
   libavdevice     61.3.100
   libavfilter     10.4.100 (runtime 10.5.100)
   libavformat     61.7.100 (runtime 61.7.102)
   libavutil       59.39.100
   libswresample   5.3.100
   libswscale      8.3.100
artim
Posts: 5
Joined: Wed May 20, 2026 9:08 am

Re: libmmbd integration with mpv

Post by artim »

Ok, that wasn't the solution. Could you by any chance check your debug logs when playing back your encrypted UHD copy? I'm seeing these lines:

Code: Select all

[bd] Opening bd://0
[bd] Blu-ray successfully opened.
[bd] resize stream to 131072 bytes, drop 0 bytes
[bd] Stream opened successfully.
[demux] Trying demuxers for level=force.
[demux] Trying demuxer: disc (force-level: force)
aacs.c:255: Unable decrypt unit (AACS)!
bluray.c:786: Skipping broken unit at 0
[disc] reset to time: 0.000000
[demux] Trying demuxers for level=force.
[demux] Trying demuxer: lavf (force-level: force)
aacs.c:255: Unable decrypt unit (AACS)!
bluray.c:786: Skipping broken unit at 6144
[lavf] No format found, try lowering probescore or forcing the format.
[cplayer] Opening failed or was aborted: bd://0
[cplayer] finished playback, unrecognized file format (reason 4)
Failed to recognize file format
There's no mentioning of libmmbd in there at any point. Not even with log verbosity set to trace.
Also, does the more verbose version information from there show any significant differences?

Code: Select all

[cplayer] mpv v0.41.0 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
[cplayer]  built on May 23 2026 11:45:47
[cplayer] libplacebo version: v7.360.1
[cplayer] FFmpeg version: 8.1.1-3
[cplayer] FFmpeg library versions:
[cplayer]    libavcodec      62.28.101
[cplayer]    libavdevice     62.3.101
[cplayer]    libavfilter     11.14.101
[cplayer]    libavformat     62.12.101
[cplayer]    libavutil       60.26.101
[cplayer]    libswresample   6.3.101
[cplayer]    libswscale      9.5.101
[cplayer] Configuration: -Ddmabuf-wayland=enabled -Ddvdnav=enabled -Dlibbluray=enabled -Dvaapi=enabled -Dvaapi-wayland=enabled
[cplayer] List of enabled features: alsa build-date cplugins debug dmabuf-interop-gl dmabuf-wayland dvbin dvdnav egl egl-wayland ffmpeg gl glibc-thread-name glob glob-posix gpl iconv jack jpeg lcms2 libarchive libass libavdevice libbluray libdl libplacebo linux-fstatfs lua52 memfd-create memrchr posix posix-shm ppoll pthread-condattr-setclock pulse vaapi vaapi-wayland vector vk-khr-display vt.h vulkan wayland wayland-protocols-1-32 wayland-protocols-1-38 wayland-protocols-1-39 wayland-protocols-1-41 wayland-protocols-1-44 wayland-protocols-1-47 x11-clipboard zimg zimg-st428 zlib
tomty89
Posts: 79
Joined: Sun Dec 13, 2020 8:48 am

Re: libmmbd integration with mpv

Post by tomty89 »

I can't help but wonder, does it make any difference if you use bd://longest, or bd://2 for the disc with:

Code: Select all

[bd] idx:   2 duration: 01:28:10 angles:  1 (playlist: 00002.mpls)
Also, have you tested with any other disc? Does it fail with both regular BD and UHD BD?
Post Reply