Closed kirkegaard closed 6 years ago
Does the first file play using mpv -vo opengl file01.mp4
? The log indicates the mpv core is correctly loading the first file and the demuxer is working as it should, but your log stops right at the point where normally the video output driver would start to do its thing. Does the program just hang at this point?
Perhaps try running the program again with the loglevel set to 'trace'
to coax mpv into producing some more information on where the problem might be.
BTW, you can also try playing the test file from this repo, which is a webm/vp8-encoded video file to make sure it's not a codec problem.
mpv -vo opengl file01.mp4
worked just fine and yes the log ends where the the scripts just hangs at wait_for_playback()
.
This is the output if i play the video using mpv:
Playing: file01.mp4
(+) Video --vid=1 (*) (h264 1280x720 23.976fps)
(+) Audio --aid=1 --alang=und (*) (aac 2ch 44100Hz)
AO: [coreaudio] 44100Hz stereo 2ch floatp
VO: [opengl] 1280x720 yuv420p
AV: 00:00:09 / 00:04:02 (3%) A-V: 0.000
I tried with the test file but the same thing happened. I tried the trace log as well but i dont see any thing that would indicate whats going on.
Heres the log. I left all the duplicated lines in there this time: https://gist.githubusercontent.com/kirkegaard/cdfbdce956245c349d373050bdce5171/raw/0453ceb2f972338666d69fc331e6c10df596f213/mpv.log
Holy crap, tried logging the test file. Its way smaller! Still same output though. https://gist.githubusercontent.com/kirkegaard/c62edffc7e71b55399c253202d7414c9/raw/4542692cfb9d9cd6c012fe925bf611cacf39c828/mpv.log
Hmm. This looks like some vo driver problem. There is a couple of things that you can try now. (Sorry, I can't reproduce your problem since I don't have any macs available)
libmpv
and mpv
on your system are reasonably recent (less than a year old or so). They might be coming from different packages (or whatever you're using on mac). You can get libmpv
's version using python3 -c 'import mpv; print(mpv._mpv_client_api_version())'
player['vo'] = 'opengl'
gdb --args python test_script.py
r [enter]
to make gdb start the program[ctrl] c
in the terminal to break into gdb's shellinfo threads [enter]
mpv/playback
using thread <its thread Id from the list> [enter]
bt [enter]
mpv/vo
If you post the gdb log here I can maybe make a guess.Any news? If you still need help, just reopen this issue.
Hey sorry, i sort of got away from this. I've testet the same code on linux at it works perfectly. It seems like its having trouble talking to the libmpv that ships with brew on osx. Im having trouble using gdb for debugging since im using pyenv. I have to figure out fixing that first :) But ill let you know when i figure something out! Thanks!
With pyenv something along the lines of gdb --args $(which python3) test_script.py
should work.
I have the same problem. On windows and x11, create multiple window is easy, but not osx. Maybe we should launch a window before we "inject" mpv video, so we can use wxpython/pyqt5 and so on. I make it work after meeting this: https://github.com/coryo/python-mpv . See the demo of pyqt5.
the main snippet(https://github.com/coryo/python-mpv/blob/master/demo/pyqt5.py#L76-L83):
self.mpv_container = QWidget(self)
wid = int(self.mpv_container.winId())
self.mpv = Mpv(parent=self,
wid=wid,
log_handler=mpv_log.debug,
log_level=mpv.LogLevel.INFO,
input_cursor=False,
hwdec='auto',
observe=['track-list', 'playback-time', 'duration'])
I'm migrating this "unknown hang on OSX" issue to #61
I was trying one of your examples but the player never seemed to launch. I tried adding some debugging code as you advised in another issue but i cant seem to figure out why its not launching the player. This is the code im using and the files are just regular h264 files. Im on osx 10.11 and using python 3.6.1 and mpv 0.25.0. The library seems to find the dylib file just fine
/usr/local/lib/libmpv.dylib
Log: https://pastebin.com/raw/U5ExvigH