vlc mac python绑定没有视频输出 [英] vlc mac python binding no video output

查看:219
本文介绍了vlc mac python绑定没有视频输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用vlc python绑定播放视频.然后我得到了这些错误:

I am using vlc python binding to play a video. Then I got these 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

视频不会显示.但是音频还可以,我可以毫无问题地听到音频.而且我也可以调用所有其他python vlc函数,例如play(),pause(),...都没有问题.只是没有视频.

The video won't show. However audio is ok, I can hear the audio without problem. And I can also call all other python vlc functions like play(), pause(), ... without problem. Just no video.

它是VLC 2.0.8 32位,OSX 10.8.4 64位和python是3.3.2 32位.直接使用VLC播放任何视频都没有问题.这仅在我使用python命令行时发生.

It's VLC 2.0.8 32bit, OSX 10.8.4 64bit, and python is 3.3.2 32bit. Using VLC directly has no problem playing any video. This only happens when I use python command line.

但是,我在Windows 7中做过同样的事情,所以一切运行正常.那么这是Mac唯一的问题吗?

However I did the same thing in windows 7, everything works perfectly. So is this a mac only problem?

我从以下位置下载我的python vlc绑定: http://liris.cnrs.fr/advene/download/python-ctypes/

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

推荐答案

只需在调用player.play()之前放一些类似这样的代码.如Oliver的评论所述,您需要创建一个Window并将其传递给VLC.

Just put some code like this just before you call player.play(). As mentioned by Oliver's comment you need to create a Window and pass it to VLC.

我尚未在任何其他平台上进行测试,但这听起来似乎在其他平台上不需要,尽管我用来启发的github上的代码似乎具有特定于系统的代码.

I haven't tested on any other platforms yet, but it sounds like this isn't needed on other platforms, although the code on github I used for inspiration seems to have system-specific 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()

这篇关于vlc mac python绑定没有视频输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆