Playing dvd says "libdvdread: Encrypted DVD support unavailable"
Important Information
- mpv version: v0.40.0-dev-g72dbcf119
- Platform version: macos 26.0.1
- Meson version: 1.9.1
Reproduction Steps
I wanted to build mpv from source because I wanted to play an external dvd with it (which is not supported with homebrew's mpv build). It built fine, but it couldn't play the dvd properly:
bash-3.2$ ./build1/mpv dvd:// --dvd-device=/Volumes/SCOOBY_DOO_2/
libdvdread: Encrypted DVD support unavailable.
libdvdread: Attempting to use device /dev/rdisk4 mounted on /Volumes/SCOOBY_DOO_2 for CSS authentication
libdvdnav: Can't read name block. Probably not a DVD-ROM device.
libdvdnav: vm: dvd_read_name failed
libdvdnav: DVD disk reports itself with Region mask 0x00fe0000. Regions: 01
libdvdnav: Suspected RCE Region Protection!!!
[dvdnav] Selecting title 0.
[dvdnav] DVDNAV, switched to title: 1
[ffmpeg/demuxer] mpeg: probed stream 0 failed
[ffmpeg/audio] ac3: exponent 25 is out-of-range
[ffmpeg/audio] ac3: error decoding the audio block
Expected Behavior
I realized the issue was the libdvdcss wasn't linked to the binary (even though it was installed):
bash-3.2$ otool -L ./build1/mpv | grep dvd
/opt/homebrew/opt/libdvdnav/lib/libdvdnav.4.dylib (compatibility version 4.0.0, current version 4.0.0)
So I checked the meson build file and saw that indeed libdvdcss isn't listed as a dependency. In Linux, it's probably a dependency of dvdnav, but in macos, it isn't:
bash-3.2$ pkg-config --cflags dvdnav
-I/opt/homebrew/Cellar/libdvdnav/7.0.0/include -I/opt/homebrew/Cellar/libdvdread/7.0.1/include
In the end, adding libdvdcss as a dependency solved the issues:
diff --git a/meson.build b/meson.build
index e37564b03455..6dd9679cff50 100644
--- a/meson.build
+++ b/meson.build
@@ -637,9 +637,11 @@ dvdnav_opt = get_option('dvdnav').require(
error_message: 'the build is not GPL!',
)
dvdnav = dependency('dvdnav', version: '>= 4.2.0', required: dvdnav_opt)
+dvdcss = dependency('libdvdcss', version: '>= 1.2.0', required: dvdnav_opt)
features += {'dvdnav': dvdnav.found()}
if features['dvdnav']
dependencies += dvdnav
+ dependencies += dvdcss
sources += files('stream/stream_dvdnav.c')
endif
Actual Behavior
Now mpv plays the encrypted dvd correctly.
Log File
This is the output of meson setup build2 after I added libdvdcss as a dependency:
bash-3.2$ meson setup build2 -Ddvdnav=enabled # -Ddvdread=enabled
The Meson build system
Version: 1.9.1
Source dir: /Users/enan/projects/mpv
Build dir: /Users/enan/projects/mpv/build2
Build type: native build
Project name: mpv
Project version: 0.40.0-UNKNOWN
C compiler for the host machine: cc (clang 17.0.0 "Apple clang version 17.0.0 (clang-1700.3.19.1)")
C linker for the host machine: cc ld64 1221.4
Host machine cpu family: aarch64
Host machine cpu: aarch64
Program python3 found: YES (/opt/homebrew/bin/python3)
Found pkg-config: YES (/opt/homebrew/bin/pkg-config) 2.5.1
Run-time dependency libavcodec found: YES 62.11.100
Run-time dependency libavfilter found: YES 11.4.100
Run-time dependency libavformat found: YES 62.3.100
Run-time dependency libavutil found: YES 60.8.100
Run-time dependency libswresample found: YES 6.1.100
Run-time dependency libswscale found: YES 9.1.100
Run-time dependency libplacebo found: YES 7.351.0
Run-time dependency libass found: YES 0.17.4
Compiler for C supports arguments -Wdisabled-optimization: YES
Compiler for C supports arguments -Wempty-body: YES
Compiler for C supports arguments -Wformat: YES
Compiler for C supports arguments -Wimplicit-fallthrough: YES
Compiler for C supports arguments -Woverflow: YES
Compiler for C supports arguments -Wparentheses: YES
Compiler for C supports arguments -Wpointer-arith: YES
Compiler for C supports arguments -Wshadow: YES
Compiler for C supports arguments -Wundef: YES
Compiler for C supports arguments -Wvla: YES
Compiler for C supports arguments -Wno-cast-function-type: YES
Compiler for C supports arguments -Wno-format-zero-length: YES
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Compiler for C supports arguments -Wno-sign-compare: YES
Compiler for C supports arguments -Wno-switch: YES
Compiler for C supports arguments -Wno-unused-parameter: YES
Compiler for C supports arguments -fno-math-errno: YES
Compiler for C supports arguments -fno-signed-zeros: YES
Compiler for C supports arguments -fno-trapping-math: YES
Compiler for C supports arguments -Wmissing-prototypes: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C supports arguments -Werror=implicit-function-declaration: YES
Compiler for C supports arguments -Wno-pointer-sign: YES
Compiler for C supports arguments -Wformat -Werror=format-security: YES
Compiler for C supports link arguments -Wl,--nxcompat,--no-seh,--dynamicbase: NO
Compiler for C supports link arguments -Wl,-z,noexecstack: NO
Run-time dependency dl found: YES
Library atomic found: NO
Compiler for C supports link arguments -rdynamic: YES
Run-time dependency threads found: YES
Header "pthread.h" has symbol "pthread_condattr_setclock" with dependency threads: NO
Run-time dependency appleframeworks found: YES (Cocoa, IOKit, QuartzCore)
Checking for function "fork" : YES
Checking for function "ppoll" : NO
Checking for function "memrchr" : NO
Library windowsapp skipped: feature uwp disabled
Checking for function "glob" : YES
Header "sys/vt.h" has symbol "VT_GETMODE" : NO
Header "sys/consio.h" has symbol "VT_GETMODE" : NO
Header "dev/wscons/wsdisplay_usl_io.h" has symbol "VT_GETMODE" : NO
Checking for function "fstatfs" : YES
Checking for function "fstatfs" : NO
Compiler for C supports function attribute vector_size: YES
Program /Users/enan/projects/mpv/TOOLS/docutils-wrapper.py found: YES (/Users/enan/projects/mpv/TOOLS/docutils-wrapper.py)
Program /Users/enan/projects/mpv/TOOLS/file2string.py found: YES (/Users/enan/projects/mpv/TOOLS/file2string.py)
Program /Users/enan/projects/mpv/TOOLS/matroska.py found: YES (/Users/enan/projects/mpv/TOOLS/matroska.py)
Program /Users/enan/projects/mpv/TOOLS/gen-mpv-desktop.py found: YES (/Users/enan/projects/mpv/TOOLS/gen-mpv-desktop.py)
Program git found: YES (/usr/bin/git)
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency libcdio found: NO (tried pkgconfig, framework and cmake)
Run-time dependency libcdio_paranoia found: NO (tried pkgconfig, framework and cmake)
Has header "linux/dvb/frontend.h" : NO
Run-time dependency dvdnav found: YES 7.0.0
Run-time dependency libdvdcss found: YES 1.5.0
Run-time dependency iconv found: YES
Run-time dependency mujs found: YES 1.3.8
Run-time dependency lcms2 found: YES 2.17
Run-time dependency libarchive found: NO (tried pkgconfig, framework and cmake)
Run-time dependency libavdevice found: YES 62.1.100
Run-time dependency libbluray found: YES 1.4.0
Library m found: YES
Library rt found: NO
Run-time dependency lua found: NO (tried pkgconfig, framework and cmake)
Run-time dependency lua52 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency lua5.2 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency lua-5.2 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency luajit found: YES 2.1.1763318511
Run-time dependency rubberband found: YES 4.0.0
Run-time dependency sdl2 found: YES 2.32.10
Run-time dependency uchardet found: YES 0.0.8
Run-time dependency vapoursynth found: YES 73
Run-time dependency vapoursynth-script found: YES 73
Run-time dependency xfixes found: YES 6.0.1
Run-time dependency x11 found: YES 1.8.12
Run-time dependency zimg found: YES 3.0.6
Run-time dependency zlib found: YES 1.2.12
Run-time dependency alsa found: NO (tried pkgconfig, framework and cmake)
Run-time dependency appleframeworks found: YES (Foundation, AudioToolbox)
Header "AudioToolbox/AudioToolbox.h" has symbol "kAudioUnitSubType_RemoteIO" : NO
Run-time dependency appleframeworks found: YES (CoreMedia, AVFoundation)
Run-time dependency appleframeworks found: YES (CoreFoundation, CoreAudio, AudioUnit, AudioToolbox)
Run-time dependency jack found: NO (tried pkgconfig, framework and cmake)
Dependency openal skipped: feature openal disabled
Header "aaudio/AAudio.h" has symbol "AAudioStream" skipped: feature aaudio disabled
Library OpenSLES found: NO
Header "sys/soundcard.h" has symbol "SNDCTL_DSP_HALT" : NO
Run-time dependency libpipewire-0.3 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency libpulse found: NO (tried pkgconfig, framework and cmake)
Run-time dependency sndio found: NO (tried pkgconfig, framework and cmake)
Header "audioclient.h" has symbol "IAudioClient" skipped: feature wasapi disabled
Run-time dependency caca found: NO (tried pkgconfig, framework and cmake)
Has header "d3d9.h" skipped: feature direct3d disabled
Run-time dependency libdrm found: NO (tried pkgconfig, framework and cmake)
Run-time dependency libdisplay-info found: NO (tried pkgconfig, framework and cmake)
Dependency gbm skipped: feature gbm disabled
Run-time dependency libjpeg found: YES 3.1.2
Dependency shaderc skipped: feature shaderc disabled
Run-time dependency libsixel found: NO (tried pkgconfig, framework and cmake)
Checking for function "shm_open" : YES
Dependency spirv-cross-c-shared skipped: feature spirv-cross disabled
Run-time dependency wayland-client found: NO (tried pkgconfig, framework and cmake)
Run-time dependency wayland-cursor found: NO (tried pkgconfig, framework and cmake)
Run-time dependency wayland-protocols found: NO (tried pkgconfig, framework and cmake)
Run-time dependency xkbcommon found: NO (tried pkgconfig, framework and cmake)
Run-time dependency wayland-client found: NO (tried pkgconfig, framework and cmake)
Has header "linux/input-event-codes.h" with dependency wayland-client: NO
Program wayland-scanner found: NO
Dependency x11 found: YES 1.8.12 (cached)
Run-time dependency xscrnsaver found: NO (tried pkgconfig, framework and cmake)
Run-time dependency xext found: YES 1.3.6
Run-time dependency xpresent found: NO (tried pkgconfig, framework and cmake)
Run-time dependency xrandr found: YES 1.5.4
Dependency xv skipped: feature xv disabled
Run-time dependency appleframeworks found: YES (OpenGL)
Library EGL skipped: feature egl-angle-lib disabled
Run-time dependency egl found: NO (tried pkgconfig, framework and cmake)
Library EGL skipped: feature egl-android disabled
Dependency wayland-egl skipped: feature egl-wayland disabled
Run-time dependency vulkan found: YES 1.4.328
Header "vulkan/vulkan_core.h" has symbol "VK_VERSION_1_3" with dependency vulkan: YES
Checking for function "vkCreateDisplayPlaneSurfaceKHR" with dependency vulkan: YES
Run-time dependency ffnvcodec found: NO (tried pkgconfig, framework and cmake)
Header "OpenGLES/ES3/glext.h" has symbol "GL_RGB32F" : NO
Run-time dependency libva found: NO (tried pkgconfig, framework and cmake)
Dependency libva-drm skipped: feature vaapi-drm disabled
Dependency libva-wayland skipped: feature vaapi-wayland disabled
Dependency libva-x11 skipped: feature vaapi-x11 disabled
Dependency libva-win32 skipped: feature vaapi-win32 disabled
Dependency vdpau skipped: feature vdpau disabled
Run-time dependency appleframeworks found: YES (CoreVideo)
Program /Users/enan/projects/mpv/TOOLS/macos-sdk-version.py found: YES (/Users/enan/projects/mpv/TOOLS/macos-sdk-version.py)
Message: Detected macOS sdk path: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Message: Detected macOS SDK: 26.0
Objective-C compiler for the host machine: clang (clang 17.0.0)
Objective-C linker for the host machine: clang ld64 1221.4
Program xcrun found: YES (/usr/bin/xcrun)
Program /Library/Developer/CommandLineTools/usr/bin/swiftc found: YES (/Library/Developer/CommandLineTools/usr/bin/swiftc)
Message: Detected Swift version: 6.2
Has header "AppKit/NSTouchBar.h" : YES
Program /Users/enan/projects/mpv/TOOLS/macos-swift-lib-directory.py found: YES (/Users/enan/projects/mpv/TOOLS/macos-swift-lib-directory.py)
Message: Detected Swift library directory: /Library/Developer/CommandLineTools/usr/lib/swift/macosx
Program rst2man found: YES (/opt/homebrew/bin/rst2man)
Program rst2html rst2html.py skipped: feature html-build disabled
Program rst2pdf skipped: feature pdf-build disabled
Configuring config.h using configuration
Message: List of enabled features: avfoundation bsd-fstatfs build-date cocoa coreaudio cplugins darwin debug dvdnav ffmpeg gl gl-cocoa glob glob-posix gpl iconv javascript jpeg lcms2 libass libavdevice libbluray libdl libplacebo luajit mac-thread-name macos-10-15-4-features macos-11-3-features macos-11-features macos-12-features macos-cocoa-cb macos-media-player macos-touchbar posix posix-shm rubberband rubberband-3 swift uchardet vapoursynth vector videotoolbox-gl videotoolbox-pl vk-khr-display vulkan x11-clipboard zimg zimg-st428 zlib
Fetching value of define "MPV_CLIENT_API_VERSION" : (((2) << 16) | (5) | 0UL)
Compiler for C supports link arguments -Wl,-Bsymbolic: NO
Program /Users/enan/projects/mpv/TOOLS/osxbundle.py found: YES (/Users/enan/projects/mpv/TOOLS/osxbundle.py)
Build targets in project: 31
mpv 0.40.0-UNKNOWN
cocoa : YES
d3d11 : NO
drm : NO
javascript: YES
libmpv : YES
lua : YES
opengl : YES
vulkan : YES
wayland : NO
x11 : NO
User defined options
dvdnav : enabled
I carefully read all instruction and confirm that I did the following:
- [x] I tested with the latest mpv version to validate that the issue is not already fixed.
- [x] I provided all required information including system and mpv version.
- [x] I produced the log file with the exact same set of parameters, and conditions used in "Reproduction Steps".
- [x] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
- [x] I attached the full, untruncated log file.
This issue is solved for me. I just wanted to repot it here in case the maintainers want to address it in the source. Otherwise it can be closed. Thank you guys for mpv.
from IRC so it's not lost.
22:59:37 kasper93: der_richter: does macos bundle copy libraries? 23:00:02 kasper93: I don't understand why adding dvdcss to mpv fixes it for them 23:00:14 kasper93: but maybe without it, the .so is not visible by dvdread? 23:01:29 der_richter: it should bundle all libraries linked to the binary and its depencies 23:01:41 der_richter: besides the system ones, or rather the ones we exclude 23:02:29 der_richter: https://github.com/mpv-player/mpv/blob/master/TOOLS/dylib_unhell.py#L11-L25 23:05:52 der_richter: yeah it's probably not visible to dvdread, eg the bundle operates in an environment that's different from your shell. 23:08:26 der_richter: *dependencies 23:11:10 kasper93: dvdread opens dvdcss with dlopen() so the bundle script probably just doesn't add this lib 23:11:30 kasper93: and they workaround this by linking dvdcss directly to mpv making bundle pull this lib 23:12:06 kasper93: we could have specific inclusion if (dvdnav) include dvdcss in dynlib script 23:13:47 der_richter: how does it dlopen it? or rather how does it get the base path? 23:15:12 kasper93: https://code.videolan.org/videolan/libdvdread/-/blob/master/src/dvd_input.c?ref_type=heads#L468 23:16:06 kasper93: it is also possible to link it statically, but this require libdvdread rebuild 23:17:35 der_richter: i could possible set a env var so it can find it in the standard paths 23:17:47 der_richter: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dlopen.3.html LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, and DYLD_FALLBACK_LIBRARY_PATH 23:20:20 der_richter: https://github.com/mpv-player/mpv/issues/17032#issuecomment-3523365097 though probably not DYLD_LIBRARY_PATH XD 23:22:33 der_richter: https://github.com/mpv-player/mpv/blob/master/osdep/mac/app_hub.swift#L62-L67 we already do some special PATH manipulations for the bundle anyway 23:27:12 der_richter: though no idea if it might be too late. to current man says "was set at launch"