python-mpv icon indicating copy to clipboard operation
python-mpv copied to clipboard

Player not opening in MacOS

Open Aniruddh-J opened this issue 2 years ago • 8 comments
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()

Aniruddh-J avatar May 02 '23 09:05 Aniruddh-J

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:

  1. Double-check that the mpv version of your command-line mpv binary and of libmpv are the same. You can get the version of the command-line binary by running mpv --version (first line of output), and the version of libmpv by running import mpv; player = mpv.MPV(); print(player.mpv_version).
  2. Make python-mpv output debug log messages, and check for any errors. You can do that by setting log_level and 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')
  1. Try changing the video output (--vo option in the command-line utility, vo parameter to mpv.MPV(...))
  2. Make sure you don't have to set some environment variable such as $DISPLAY on your shell to get libmpv to find your display output

jaseg avatar Jun 03 '23 16:06 jaseg

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.

frankchau93 avatar Nov 03 '23 00:11 frankchau93