jaseg / python-mpv

Python interface to the awesome mpv media player
https://git.jaseg.de/python-mpv.git
Other
547 stars 68 forks source link

python-mpv to Play DVD's #73

Closed tuxfoo closed 6 years ago

tuxfoo commented 6 years ago

Hi,

I cannot seem to get python-mpv to work with DVD's.

        self.dvdplayer = mpv.MPV()
        self.dvdplayer.fullscreen = True
        self.dvdplayer['vo'] = 'rpi'
        self.dvdplayer.play('/tmp/DVD/')

If I run mpv /tmp/DVD it will work and i get the following line which is missing when I use the wrapper [ifo/dvdnav] .IFO detected. Redirecting to dvd://

Update: It appears to be an issue with threading and not with DVD's

Fatal Python error: could not acquire lock for <_io.BufferedWriter name='<stdout>'> at interpreter shutdown, possibly due to daemon threads

Thread 0x6c5ff470 (most recent call first):
  File "/home/pi/mirrorcast/server/mpv.py", line 469 in _event_loop
  File "/usr/lib/python3.5/threading.py", line 862 in run
  File "/usr/lib/python3.5/threading.py", line 914 in _bootstrap_inner
  File "/usr/lib/python3.5/threading.py", line 882 in _bootstrap

Current thread 0x76fe9010 (most recent call first):
Aborted

I will try recompiling libmpv and see how it goes.

Cheers,

tuxfoo commented 6 years ago

I had to recompile libass, ffmpeg and mpv and now it is working. I used ffmpeg master,libass release and mpv-build(master).

ffmpeg options

--enable-mmal
--enable-shared
--enable-gpl 
--enable-nonfree 
--enable-static 
--enable-libx264 
--enable-libfdk-aac 
--enable-libvpx 
--enable-libopus 
--enable-libmp3lame 
--enable-libtheora
--enable-libvorbis
--enable-omx
--enable-omx-rpi
--enable-libxcb
--enable-libfreetype
--enable-libass
--enable-gnutls
--disable-opencl

mpv-build options

--enable-libmpv-shared
--enable-rpi 
--enable-dvdread 
--enable-dvdnav 
--enable-cdda

and for libass I used --enable-shared

Now python-mpv is working.