Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-mpv not playing #77

Open
jdauthre opened this issue Oct 15, 2018 · 4 comments
Open

python-mpv not playing #77

jdauthre opened this issue Oct 15, 2018 · 4 comments

Comments

@jdauthre
Copy link

Hi, using python 3.7 on High Sierra (mac). Have installed mpv , python-mpv and adlib, tried running the test script:

import mpv
player = mpv.MPV(ytdl=True)
player.play('/Applications/thehandle/Japaneasy.mp4')

I get no errors but it just runs through (via idle) and exits without playing anything
I am assuming if it wasnt able to access the various requirements an error would show up.( I am new to this ). I got it all working in Windows, and was hoping to replicate it in osx. Any ideas?

Many thanks

@jaseg
Copy link
Owner

jaseg commented Oct 16, 2018

Hmm, are you running this from an interactive shell or as a script? If you're running this as a script you need to add player.wait_for_playback() at the end. Otherwise python will exit right after mpv started playing, taking down mpv in the process.

If it still doesn't work, you can try debugging with

player = mpv.MPV(log_handler=print, loglevel='debug') # For log levels see man mpv.

@jdauthre
Copy link
Author

jdauthre commented Oct 16, 2018 via email

@jdauthre
Copy link
Author

I am now getting some errors (I did fiddle with the locations of the dependencies earlier), so with the script:
import mpv
player = mpv.MPV(ytdl=True)
player.play('/Applications/thehandle/Japaneasy.mp4')
player = mpv.MPV(log_handler=print, loglevel='debug')
player.wait_for_playback()

I get runtime errors:
output.txt
I noticed you mentioned there is a problem with osx around the event logic, but it seemed it was about qt which I am not using.

@jaseg
Copy link
Owner

jaseg commented Nov 10, 2019

That runtime error is caused by mpv geting a log-handler option it doesn't know. The log_handler parameter to the MPV constructor is supposed to be caught by that constructor and not passed through to MPV. Are you sure you are using a recent version of python-mpv?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants