Vlc mac python does not bind video output

I am using python vlc binding to play video. Then I got the following errors:

[0x3d0c58] main window error: corrupt module: /Applications/VLC.app/Contents/MacOS/plugins/libmacosx_plugin.dylib [0x3c9af8] vout_macosx vout display error: No drawable-nsobject nor vout_window_t found, passing over. [0x3178a98] main video output error: video output creation failed [0xa48c98] main decoder error: failed to create video output 

Video will not be displayed. However, the sound is fine, I can hear the sound without any problems. And I can also name all other python vlc functions like play (), pause (), ... no problem. There is simply no video.

These are VLC 2.0.8 32bit, OSX 10.8.4 64bit and python - 3.3.2 32 bit. Using VLC directly does not cause video playback problems. This only happens when using the python command line.

However, I did the same in Windows 7, everything works fine. So is this a mac-only issue?

I download my python vlc bindings from: http://liris.cnrs.fr/advene/download/python-ctypes/

+4
source share
2 answers

The specified solution (use -I macosx) works because it launches an interface that provides an NSObject (macosx window handle) for the vout_macosx module. When starting from libvlc by default, this interface / window is missing. It works on other platforms because the video output modules know how to create their own windows, but this does not apply to macosx.

You have 2 options:

  • create a window in macosx (using either the native cocoa API or the lib widget, for example Qt), and pass its link through the set_nsobject () method

  • install the XQuartz X11 server and use the x11 video output module (not very satisfactory and efficient, but it works)

+1
source

Just put some code like this before you call player.play (). As mentioned by Oliver, you need to create a window and pass it to the VLC.

I haven't tested it on any other platforms yet, but it doesn't seem to be needed on other platforms, although the code on github that I used for inspiration seems to have system code.

  if sys.platform == "darwin": from PyQt4 import QtCore from PyQt4 import QtGui import sys vlcApp =QtGui.QApplication(sys.argv) vlcWidget = QtGui.QFrame() vlcWidget.resize(700,700) vlcWidget.show() player.set_nsobject(vlcWidget.winId()) player.play() 
+1
source

Source: https://habr.com/ru/post/1497742/


All Articles