我正在尝试使用vlc录制直播。
我猜,问题是我的应用无法检测到已安装的vlc。我使用安装
pip install python-vlc
香港专业教育学院试图将我的.py文件放到vlc文件夹中,但随后我又遇到了另一个问题
[00212d24] main libvlc error: No modules were found, refusing to start. Check that you properly gave a module path with --plugin-path.
Traceback (most recent call last):
File "asdads.py", line 25, in <module>
grabar_audio(radio, datos)
File "asdads.py", line 13, in grabar_audio
player = instancia.media_player_new()
AttributeError: 'NoneType' object has no attribute 'media_player_new'
import sys
import vlc
from time import sleep
def grabar_audio(stream, parametros):
radio = stream
datos = parametros
instancia = vlc.Instance()
player = instancia.media_player_new()
media = instancia.media_new(radio, datos)
media.get_mrl()
我该如何解决?
最佳答案
python-vlc是python与vlc程序(或包装器库)的绑定。这是一种通过python运行vlc程序的方法(python->绑定-> vlc)。因此,您需要执行以下步骤:
1) copy vlc.py to where you run your application
2) download vlc program and install it in your machine
3) restart your machine and run notebook again
您已完成步骤1,因此可以在以下链接中下载并安装vlc(64位):https://download.cnet.com/VLC-Media-Player-64-bit/3000-13632_4-75761094.html
关于python - AttributeError:模块“vlc”没有属性“Instance”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55692023/