play-with-mpv python server problem I'm used to use Play with MPV Chrome extension on Arch linux which works also on MacOS. The problem is it isn't working as service for me on MacOS.

If I start directly play-with-mpv in terminal, the server is listening on port 7521 and I can run youtube video in MPV with right click inside Chrome.

If I start play-with-mpv as LauncherAgents service with proper plist it starts, listens but does nothing.. right inside Chrome on Play with MPV does nothing. 

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;play.with.mpv&lt;/string&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;Program&lt;/key&gt;
    &lt;string&gt;/Users/e/Library/Python/3.7/bin/play-with-mpv&lt;/string&gt;
    &lt;key&gt;KeepAlive&lt;/key&gt;
    &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Port listening

Python    2673              e    3u  IPv4 0x51d94fea3b0e559f      0t0    TCP *:7531 (LISTEN)


Content of the play-with-mpv server launcher

#!/usr/local/opt/python/bin/python3.7

# -*- coding: utf-8 -*-
import re
import sys

from server import start

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(start())


I also tried to put play-with-mpv inside Users &amp; Groups &gt; Login items with the same result as in LaunchAgents.

play.with.mpv.plist is located at ~/Library/LaunchAgents/play.with.mpv.plist

Tried also load it via launchctl

launchctl load ~/Library/LaunchAgents/play.with.mpv.plist


While direct calling play-with-mpv in terminal the request is working and mpv pops out

http://localhost:7531/?play_url=https://www.youtube.com/watch?v=BoY1TNKO-bY


but as a running service that address is unaccessible and does nothing. Weird is I can ping localhost at port 7531, is up and running and listening.

I'm very new in MacOS so please be patient with me :) Thanks

UPDATE

as for now this is partly working (added PATH and full python3.7 path) 

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;EnvironmentVariables&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;PATH&lt;/key&gt;
        &lt;string&gt;/Users/e/Library/Python/3.7/bin:/usr/local/bin&lt;/string&gt;
    &lt;/dict&gt;
    &lt;key&gt;KeepAlive&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;play.with.mpv&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/usr/local/bin/python3.7&lt;/string&gt;
        &lt;string&gt;/Users/e/Library/Python/3.7/bin/play-with-mpv&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;StandardErrorPath&lt;/key&gt;
    &lt;string&gt;/tmp/play.with.mpv.stderr&lt;/string&gt;
    &lt;key&gt;StandardOutPath&lt;/key&gt;
    &lt;string&gt;/tmp/play.with.mpv.stdout&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;


BUT there's still something unordinary. The video is dropping frames (around 3-4/s). If I run that same video directly from terminal with eg; mpv https://www.youtube.com/watch?v=BoY1TNKO-bY or by running the play-with-mpv server manually, the video is running fine, zero dropped frames.
Got it working. Here's the full solution:

Plist: ~/Library/LaunchAgents/play.with.mpv.plist

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Disabled&lt;/key&gt;
    &lt;false/&gt;
    &lt;key&gt;EnvironmentVariables&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;PATH&lt;/key&gt;
        &lt;string&gt;/Users/e/Library/Python/3.7/bin:/usr/local/bin&lt;/string&gt;
    &lt;/dict&gt;
    &lt;key&gt;KeepAlive&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;play.with.mpv&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/usr/local/bin/python3&lt;/string&gt;
        &lt;string&gt;/Users/e/Library/Python/3.7/bin/play-with-mpv&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;StandardErrorPath&lt;/key&gt;
    &lt;string&gt;/tmp/play.with.mpv.stderr&lt;/string&gt;
    &lt;key&gt;StandardOutPath&lt;/key&gt;
    &lt;string&gt;/tmp/play.with.mpv.stdout&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Mind the PATH to python3 - find it with which python3 and the play-with-mpv python script!

Load plist:

launchctl load ~/Library/LaunchAgents/play.with.mpv.plist


mpv config in ~/.config/mpv/mpv.conf

video-sync=display-resample


if this does not help, try this instead

opengl-early-flush=no


That video-sync parameter was the key - not a single dropped frame anymore.