python-mpv
python-mpv copied to clipboard
Player not opening in MacOS
trafficstars
Hello,
I installed mpv using Homebrew and tested if it is working with the command mpv {filename} but it doesn't work using this Python library:
player.play(video_file)
player.wait_until_playing() // or player.wait_for_playerback()
I cannot help you with that since I don't have an Apple device to test this on. Here's a few suggestions of what you could try:
- Double-check that the mpv version of your command-line
mpvbinary and of libmpv are the same. You can get the version of the command-line binary by runningmpv --version(first line of output), and the version of libmpv by runningimport mpv; player = mpv.MPV(); print(player.mpv_version). - Make python-mpv output debug log messages, and check for any errors. You can do that by setting
log_leveland registering a log handler like this:
def my_log(loglevel, component, message):
print('[{}] {}: {}'.format(loglevel, component, message.strip()))
player = mpv.MPV(log_handler=my_log, loglevel='debug')
- Try changing the video output (
--vooption in the command-line utility,voparameter to mpv.MPV(...)) - Make sure you don't have to set some environment variable such as
$DISPLAYon your shell to get libmpv to find your display output
I'm running into the same issue. The debug logs look like it's running but nothing shows. Just a python icon that pops up but no player.