# Playback of BluRay disks?



## David Chisnall (Dec 14, 2015)

Has anyone managed to play BluRay disks with FreeBSD?  I have a BluRay drive and tried building the multimedia/vlc port with libbluray support enabled, but even with the KEYDB.cfg file from the vlc-bluray site installed I get an unhelpful error message.  Has anyone ever managed to make this work (and, if so, how)?  The machine I'm using has loads of spare disk space, so ripping prior to playback would be fine, but the only machine that I own that has a BluRay drive has only FreeBSD installed so solutions that involve other operating systems won't help me.


----------



## sidetone (Dec 15, 2015)

Did you try choosing the LGPL and Non-Free options in multimedia/ffmpeg? That's what I did to get dvd's to work, and it seems it would be a requirement for bluray's too. There's an option for libbluray in ffmpeg and multimedia/vlc-qt4 too. I realize you use the newer version of vlc with qt5, but the one with qt4 is the one I use.

I just bought a blu-ray drive, but haven't tried that part yet. I'll try it soon enough.


----------



## zeissoctopus (Jan 22, 2016)

You may try to play blue-ray disc only by FreeBSD 11-Current.


----------



## cellini (Mar 14, 2018)

Did any of you get to watch BluRay on freebsd? i tried to recompile ffmpeg and vlc but no luck, any sugestions?


----------



## sidetone (Mar 15, 2018)

cellini said:


> Did any of you get to watch BluRay on freebsd? i tried to recompile ffmpeg and vlc but no luck, any sugestions?


Did you set nonfree and gpl in ffmpeg?


----------



## rigoletto@ (Mar 15, 2018)

I do not have a bluray drive but as already pointed out multimedia/ffmpeg do have the LIBBLURAY OFF by default.

Also, multimedia/mpv may be worthy to try instead of multimedia/vlc.

EDIT: LoL this is a late 2015 thread.


----------



## cellini (Mar 15, 2018)

Yea i know it is an old thread, but could not find any one that actually had gotten bluray to work,

i am pretty shure my multimedia/ffmpeg make config is right but pasting it here any how


```
# This file is auto-generated by 'make config'.
# Options for ffmpeg-3.4.1_7,1
_OPTIONS_READ=ffmpeg-3.4.1_7,1
_FILE_COMPLETE_OPTIONS_LIST=ALSA AMR_NB AMR_WB ASS BS2B CACA CDIO CELT CHROMAPRINT DC1394 DEBUG DOCS DRM FDK_AAC FFSERVER FLITE FONTCONFIG FREETYPE FREI0R FRIBIDI GME GSM ICONV ILBC JACK KVAZAAR LADSPA LAME LIBBLURAY LIBRSVG2 LIBXML2 MMX MODPLUG OPENAL OPENCL OPENCV OPENGL OPENH264 OPENJPEG OPTIMIZED_CFLAGS OPUS PULSEAUDIO RTCPU RUBBERBAND SDL SMB SNAPPY SNDIO SOXR SPEEX SSE SSH TESSERACT THEORA TWOLAME V4L VAAPI VDPAU VIDSTAB VORBIS VO_AMRWBENC VPX WAVPACK WEBP X264 X265 XCB XVID XVIDEO ZIMG ZMQ ZVBI GCRYPT GMP LIBRTMP GNUTLS OPENSSL GPL3 NONFREE
OPTIONS_FILE_UNSET+=ALSA
OPTIONS_FILE_UNSET+=AMR_NB
OPTIONS_FILE_UNSET+=AMR_WB
OPTIONS_FILE_UNSET+=ASS
OPTIONS_FILE_UNSET+=BS2B
OPTIONS_FILE_UNSET+=CACA
OPTIONS_FILE_UNSET+=CDIO
OPTIONS_FILE_UNSET+=CELT
OPTIONS_FILE_UNSET+=CHROMAPRINT
OPTIONS_FILE_UNSET+=DC1394
OPTIONS_FILE_UNSET+=DEBUG
OPTIONS_FILE_SET+=DOCS
OPTIONS_FILE_UNSET+=DRM
OPTIONS_FILE_UNSET+=FDK_AAC
OPTIONS_FILE_SET+=FFSERVER
OPTIONS_FILE_UNSET+=FLITE
OPTIONS_FILE_SET+=FONTCONFIG
OPTIONS_FILE_SET+=FREETYPE
OPTIONS_FILE_SET+=FREI0R
OPTIONS_FILE_UNSET+=FRIBIDI
OPTIONS_FILE_UNSET+=GME
OPTIONS_FILE_UNSET+=GSM
OPTIONS_FILE_SET+=ICONV
OPTIONS_FILE_UNSET+=ILBC
OPTIONS_FILE_UNSET+=JACK
OPTIONS_FILE_UNSET+=KVAZAAR
OPTIONS_FILE_UNSET+=LADSPA
OPTIONS_FILE_UNSET+=LAME
OPTIONS_FILE_SET+=LIBBLURAY
OPTIONS_FILE_UNSET+=LIBRSVG2
OPTIONS_FILE_UNSET+=LIBXML2
OPTIONS_FILE_SET+=MMX
OPTIONS_FILE_UNSET+=MODPLUG
OPTIONS_FILE_UNSET+=OPENAL
OPTIONS_FILE_UNSET+=OPENCL
OPTIONS_FILE_SET+=OPENCV
OPTIONS_FILE_UNSET+=OPENGL
OPTIONS_FILE_UNSET+=OPENH264
OPTIONS_FILE_UNSET+=OPENJPEG
OPTIONS_FILE_SET+=OPTIMIZED_CFLAGS
OPTIONS_FILE_SET+=OPUS
OPTIONS_FILE_UNSET+=PULSEAUDIO
OPTIONS_FILE_SET+=RTCPU
OPTIONS_FILE_UNSET+=RUBBERBAND
OPTIONS_FILE_UNSET+=SDL
OPTIONS_FILE_UNSET+=SMB
OPTIONS_FILE_UNSET+=SNAPPY
OPTIONS_FILE_UNSET+=SNDIO
OPTIONS_FILE_UNSET+=SOXR
OPTIONS_FILE_UNSET+=SPEEX
OPTIONS_FILE_SET+=SSE
OPTIONS_FILE_UNSET+=SSH
OPTIONS_FILE_UNSET+=TESSERACT
OPTIONS_FILE_SET+=THEORA
OPTIONS_FILE_UNSET+=TWOLAME
OPTIONS_FILE_SET+=V4L
OPTIONS_FILE_SET+=VAAPI
OPTIONS_FILE_SET+=VDPAU
OPTIONS_FILE_UNSET+=VIDSTAB
OPTIONS_FILE_SET+=VORBIS
OPTIONS_FILE_UNSET+=VO_AMRWBENC
OPTIONS_FILE_SET+=VPX
OPTIONS_FILE_UNSET+=WAVPACK
OPTIONS_FILE_UNSET+=WEBP
OPTIONS_FILE_SET+=X264
OPTIONS_FILE_SET+=X265
OPTIONS_FILE_UNSET+=XCB
OPTIONS_FILE_SET+=XVID
OPTIONS_FILE_UNSET+=XVIDEO
OPTIONS_FILE_UNSET+=ZIMG
OPTIONS_FILE_UNSET+=ZMQ
OPTIONS_FILE_UNSET+=ZVBI
OPTIONS_FILE_UNSET+=GCRYPT
OPTIONS_FILE_SET+=GMP
OPTIONS_FILE_UNSET+=LIBRTMP
OPTIONS_FILE_SET+=GNUTLS
OPTIONS_FILE_UNSET+=OPENSSL
OPTIONS_FILE_SET+=GPL3
OPTIONS_FILE_SET+=NONFREE
```

 I am also setting up a build for multimedia/mpv to check that out.


i tried running `mpv /dev/cd0` with the folloving result

```
anders@kontorbsd:~ % mpv /dev/cd0
Playing: /dev/cd0
Empty playlist!


Exiting... (End of file)
```


----------



## tobik@ (Mar 15, 2018)

cellini said:


> i tried running  mpv /dev/cd0  with the folloving result


That should be more like `mpv bd://` for Blu-ray (see mpv(1)). Though if it really works I don't know.


----------



## cellini (Mar 15, 2018)

tried running


```
anders@kontorbsd:~ % mpv bd:///dev/cd0
Playing: bd:///dev/cd0
disc.c:323: failed opening UDF image dev/cd0
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
[bd] Couldn't open Blu-ray device: dev/cd0
No protocol handler found to open URL bd:///dev/cd0
The protocol is either unsupported, or was disabled at compile-time.


Exiting... (Errors when loading file)
```

no sucsess so tried going back to poudriere deleted my  /usr/local/etc/poudriere.d/current-options/ folder and made a /usr/local/etc/poudriere.d/current-make.conf insted  containing 


```
WITH_PKGNG=yes       # Only required for versions before 10.0
CC=clang             # Highly recommended over GCC,
CXX=clang++          # but only needed for 8.X and 9.X
CPP=clang-cpp        # since it's the default in 10.0
FETCH_BEFORE_ARGS=-p4 -T 10
MASTER_SITE_BACKUP?= \
http://ftp2.us.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR/}
OPTIONS_UNSET= DEBUG
OPTIONS_SET= NONFREE CUPS LIBBLURAY
```

and run `sudo poudriere bulk -j current `portmaster --list-origins`` to rebuild my package repo


----------



## tobik@ (Mar 15, 2018)

cellini said:


> tried running
> 
> 
> ```
> ...


It's clear that Blu-ray support is compiled in or we wouldn't see [bd] in the output. But `mpv bd:///dev/cd0` is wrong and should be `mpv bd:////dev/cd0` (with an additional /). However just not specifying /dev/cd0 at all should work too. Have you tried with just `mpv bd://` as I suggested above?


----------



## cellini (Mar 15, 2018)

tobik@ said:


> It's clear that Blu-ray support is compiled in or we wouldn't see [bd] in the output. But `mpv bd:///dev/cd0` is wrong and should be `mpv bd:////dev/cd0` (with an additional /). However just not specifying /dev/cd0 at all should work too. Have you tried with just `mpv bd://` as I suggested above?


Ah sorry I misunderstood you, I will test that on Monday and see if that makes any difference, I will keep you updated


----------



## cellini (Mar 19, 2018)

finish rebuilding and run the command

```
anders@kontorbsd:~ % mpv bd://
Playing: bd://
[bd] No Blu-ray device/location was specified ...
No protocol handler found to open URL bd://
The protocol is either unsupported, or was disabled at compile-time.


Exiting... (Errors when loading file)
```
 Stil the same response like i havent compiled ffmpeg with bluray suport


maybe anyone see something wrong her.

```
anders@kontorbsd:~ % pkg info mpv
mpv-0.27.2_1,1
Name           : mpv
Version        : 0.27.2_1,1
Installed on   : Tue Mar 20 00:19:07 2018 CET
Origin         : multimedia/mpv
Architecture   : FreeBSD:12:amd64
Prefix         : /usr/local
Categories     : audio multimedia
Licenses       : GPLv2+, LGPL21+
Maintainer     : cpm@FreeBSD.org
WWW            : https://mpv.io
Comment        : Free and open-source general-purpose video player
Options        :
    ALSA           : off
    ARCHIVE        : on
    ASS            : on
    CACA           : off
    CDIO           : off
    DOCS           : on
    DVDNAV         : on
    DVDREAD        : on
    JACK           : off
    LCMS2          : off
    LIBBLURAY      : on
    LUAJIT         : off
    MANPAGES       : on
    OPENGL         : on
    PULSEAUDIO     : off
    SDL            : off
    SMB            : off
    SNDIO          : off
    TEST           : off
    UCHARDET       : on
    V4L            : on
    VAAPI          : on
    VDPAU          : on
    WAYLAND        : off
    X11            : on
    YTDL           : on
    ZSH            : off
Shared Libs required:
    libavutil.so.55
    libXext.so.6
    libjpeg.so.8
    libswresample.so.2
    libXv.so.1
    libavdevice.so.57
    libXss.so.1
    libvdpau.so.1
    libva.so.2
    libX11.so.6
    libgbm.so.1
    libavfilter.so.6
    libavcodec.so.57
    libv4l2.so.0
    libarchive.so.13
    libGL.so.1
    libEGL.so.1
    libbluray.so.2
    liblua-5.2.so
    libdvdread.so.4
    libswscale.so.4
    libva-x11.so.2
    libXrandr.so.2
    libavformat.so.57
    libass.so.9
    libdvdnav.so.4
    libXinerama.so.1
    libuchardet.so.0
Shared Libs provided:
    libmpv.so.1
Annotations    :
    FreeBSD_version: 1200058
    repo_type      : binary
    repository     : poudriere
Flat size      : 4.62MiB
Description    :
Mpv is based on the MPlayer and mplayer2 projects which it greatly improves.
It supports a wide variety of video file formats, audio and video codecs, and
subtitle types. Special input URL types are available to read input from
a variety of sources other than disk files. Depending on platform, a variety of
different video and audio output methods are supported.

WWW: https://mpv.io
anders@kontorbsd:~ %
```


----------



## CraigW (Mar 20, 2018)

Haven't tried in a while, so I did again.

Holy cow!!!

vlc-qt4 played a commercial bluray for me.

Note:  The playback quality was not subjectively great.  That could be interlacing, post processing, etc, not tweaked.










`uname -KUrm
11.1-RELEASE-p8 amd64 1101001 1101001`



```
pkg info vlc-qt4
vlc-qt4-2.2.8_2,4
Name           : vlc-qt4
Version        : 2.2.8_2,4
Installed on   : Sat Mar 17 21:33:59 2018 CDT
Origin         : multimedia/vlc-qt4
Architecture   : FreeBSD:11:amd64
Prefix         : /usr/local
Categories     : ipv6 multimedia net audio www
Licenses       : GPLv2
Maintainer     : [EMAIL]multimedia@FreeBSD.org[/EMAIL]
WWW            : [URL]https://www.videolan.org[/URL]
Comment        : Qt 4 based multimedia player and streaming server
Options        :
[B].....[/B]
Annotations    :
        FreeBSD_version: 1101001
        repo_type      : binary
        repository     : myrepo
```



```
cd /usr/ports/multimedia/vlc-qt4 && make pretty-print-config
+A52 -AALIB -ASS +AVAHI -CACA +DBUS +DCA -DOCS +DVDNAV +DVDREAD +FAAD +FLAC -FLUID -FREERDP -FRIBIDI -GME -GNOMEVFS2 -GNUTLS -GOOM +HTTPD -JACK -KATE +LIBBLURAY -LIBRSVG2 -LIBSSH2 -LIRC +LIVEMEDIA +LUA +MAD +MATROSKA -MODPLUG +MPEG2 -MTP -MUSEPACK +NCURSES +NLS -NOTIFY +OGG +OPTIMIZED_CFLAGS +OPUS +PNG -PULSEAUDIO -REALRTSP -RUNROOT +SAMPLERATE -SCHROEDINGER -SDL -SHOUTCAST -SIDPLAY -SKINS -SMB -SNDIO +SPEEX +STREAM +TAGLIB +THEORA +TWOLAME -UPNP +V4L +VAAPI +VCD +VDPAU +VORBIS +X11 +X264 +X265 -ZVBI
```


```
grep -i fifth /home/USER/.config/aacs/KEYDB.cfg
0x51D3196D53CB2AA3166B3E397370543C28E2C66B = FIFTH_ELEMENT | V | 0xE41477F733F47C263D1B1A3DECD14EEC ; MKBv3/FindVUK 0.99
0xC7F9701A56253E2BF13358020CEAB500D24A770D = FIFTH_ELEMENT_BDROM | V | 0x38CBB635986B96F2953AD63A3F20703A
0x8426FAEB73F33D9F5A8E615648D99A6D3EA34150 = THE FIFTH ELEMENT | V | 0x7A5BD9D99B77C8895526435B4154292E
0x611AA21956DB4DAA6EBD979F846CCD4C81EE0D42 = The Fifth Element | V | 0x72362EFBB602D288B7D572E79284B53E
0xC62B581356BE77E4EC8F596BD262700979526E2D = THE_FIFTH_ELEMENT | V | 0xB0B6B37BA445363F990FC75D07CA1422 ; 2015-08-28 MKBv57/FindVUK 1.00
```

`vlc` - edited - `vlc bluray:///dev/cd0`

```
VLC media player 2.2.8 Weatherwax (revision 2.2.7-14-g3cc1d8cba9)
[0000000802449050] core libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
mmc_device_linux.c:145: Only block devices supported
[000000081b820050] libbluray demux: First play: 1, Top menu: 1
HDMV Titles: 19, BD-J Titles: 0, Other: 0
[000000081b820050] libbluray demux: Adding ES 4113
[000000081b820050] libbluray demux: Adding ES 4352
[000000081b820050] libbluray demux: Adding ES 4353
[000000081b60d050] ts demux: HDMV registration not implemented for pid 0x1102 type 0x81
[000000081b820050] libbluray demux: Adding ES 4354
[B]....[/B]
[000000081b820050] libbluray demux: Adding ES 4615
[000000081b63b750] packetizer_mlp packetizer: MLP channels: 6 samplerate: 48000
[B]....[/B]
Failed to open VDPAU backend Shared object "libvdpau_va_gl.so" not found, required by "vlc"
[h264 @ 0x81b85a900] co located POCs unavailable
[h264 @ 0x81b85a900] error while decoding MB 13 19, bytestream -12
[000000081b820050] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 6, expected 5) for PID 0
[000000081b820050] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 6, expected 5) for PID 256
Failed to open VDPAU backend Shared object "libvdpau_va_gl.so" not found, required by "vlc"
[h264 @ 0x81b85a900] error while decoding MB 8 24, bytestream -24
```

Part of /etc/make.conf

```
CPUTYPE?=native                         # this works most of the time
MACHINE_CPU+=sse42 sse41 ssse3 sse3     # /usr/share/mk/cpu does not grok native

.if ${.CURDIR:M*/www/firefox*}          # firefox/rust/gecko/$RUSTFLAG cannot
.undef CPUTYPE                          # handle CPUTYPE?=native for my cpu
.endif

BATCH=yes                               # don't hassle me
TERM=dumb                               # disables color diags for compilers

DEFAULT_VERSIONS+=ssl=openssl
VALID_CATEGORIES+=local
QT4_OPTIONS=CUPS QGTKSTYLE
TESSERACT_LANGS=eng

OPTIONS_SET+=\
        CPU_OPTS SIMD SSE SSE2 SSE3 SSSE3 SSE41 SSE42 \
        OPTIMIZATIONS OPTIMIZED_CFLAGS OPTIMIZED_FLAGS \
        PTHREAD PTHREADS THREAD THREADS THREADSAFE TTB \
        RTCPU RUNTIME DYNAMIC_ARCH OPENBLAS OPENMP OPENMPI OPENSSL \
        DC1394 DVDREAD FFMPEG LIBBLURAY MAD XVID X264 X265 DECRYPT \
        AVAHI DBUS HAL ICONV NCURSES NLS LDAP GSSAPI_MIT \
        DYNAMIC PYTHON SUID SYSLOG \
        MAN MANPAGES VERBOSE VERBOSE_BUILD \
        COMPOSITE GALLIUM GLX GUI OPENGL X11 \
        ALSA PORTAUDIO FLAC LAME MP3 OGG XMMS 7ZIP \
        GIF IMAGEMAGICK JPEG PANGO PNG PNM RAR TIFF ZIP ZLIB
# patent encumbered
OPTIONS_SET+=\
        DVDCSS FDK_AAC VTKMPEG2 NONFREE

OPTIONS_UNSET+=\
        AVX AVX2 NETLIB \
        DEVD MDNS MDNSRESPONDER NSS GNUTLS POLARSSL WOLFSSL \
        OSS CPU_CLIP ESOUND JACK NAS OPENAL PULSEAUDIO \
        APIDOCS APIDOC DOCS DOXYGEN EXAMPLES HTMLDOCS INFO \
        PDFDOCS PROFILE RUBY RBLAS TEST GSSAPI_BASE GSSAPI_HEIMDAL GSSAPI_NONE

# fix some problems with the port OPTIONS_[UN]SET conflicts above
audio_espeak_UNSET+=RUNTIME
databases_virtuoso_UNSET+=IMAGEMAGICK
devel_kf5-extra-cmake-modules_SET+=TEST
editors_vim_UNSET+=X11
security_pinentry_SET+=TTY
security_pinentry_UNSET+=QT4 NCURSES GTK2 GNOME3
www_apache24_SET+=INFO
www_firefox_SET+=PROFILE
```


----------



## tobik@ (Mar 20, 2018)

cellini said:


> finish rebuilding and run the command
> 
> ```
> anders@kontorbsd:~ % mpv bd://
> ...


Have you tried with `mpv bd:////dev/cd0` (with 4 slashes between : and dev) as well?


----------



## giahung1997 (Mar 20, 2018)

Why don't use SMPlayer as frontend to MPV?


----------

