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

mac error on launching example #148

Open
jdauthre opened this issue Jan 12, 2021 · 6 comments
Open

mac error on launching example #148

jdauthre opened this issue Jan 12, 2021 · 6 comments

Comments

@jdauthre
Copy link

I am using mojave on my mac and have installed libmpv via homebrew and python-mpv via pip3. on launching a simple example via idle:
import mpv
player = mpv.MPV(ytdl=True)
player.play('/Documents/NHK.mp4')
player.wait_for_playback()

I get an error:
Traceback (most recent call last):
File "/Users/jdauthre/Documents/python/mpvmini.py", line 1, in
import mpv
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/mpv.py", line 52, in
backend = CDLL(sofile)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ctypes/init.py", line 373, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/usr/local/lib/libmpv.dylib, 6): Symbol not found: _$sSo13NSWindowLevela6AppKit01_cdD23NumericRawRepresentableACMc
Referenced from: /usr/local/lib/libmpv.dylib
Expected in: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftAppKit.dylib
in /usr/local/lib/libmpv.dylib

What do I need to do to get it to run?
Thanks in advance

@jdauthre
Copy link
Author

Anyone?

@jaseg
Copy link
Owner

jaseg commented Jan 19, 2021

I'm not a mac user, but this error would could be explained by the system libraries being updated. A libmpv version compiled and linked for an older library version might not work with a newer version.

If I am guessing right, you can fix this by updating/recompiling your libmpv using homebrew. From a quick search it looks like brew reinstall --build-from-source should do the trick.

@jdauthre
Copy link
Author

thanks I will try this

@jdauthre
Copy link
Author

jdauthre commented Feb 9, 2021

Unfortunately it didn't work, so I moved on to trying it on Catalina. It works fine on that. However if I may another issue has appeared. I have a wx.slider in the script which acts as a progess bar and as a seek so you can move quickly though the video to find the place you want. All works well on windows, but on the mac you can go maybe 100 secs and it freezes, how far it gets is variable depending on how quickly I move the slider and other unknown variables. I am assuming as the basic coding is presumably correct that it is a speed/buffer issue? but I can't find which buffer to focus on and how to increase the size. Any ideas?

@jaseg
Copy link
Owner

jaseg commented Feb 9, 2021 via email

@jdauthre
Copy link
Author

Thanks! I tried gdb but kept getting a 'gdb mac warning: unhandled dyld version (16)' which on googling looked as if I would spend more time debugging the debugger than the application! However I did manage to narrow down the issue to the seek() function on the core module. wx does have a timer, but the wx.slider doesn't have an 'on press' handler, and after some experimenting I got it to work by using the wx.timer, disabling the event handler for the slider, seeking to the new position, and using a wx.thumbup handler to stop the timer and renable the first handler. So all is good

btw python-mpv is great thanks, I was looking for an alternative to Gstreamer which I found to be very buggy.

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