我试图使用 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 -> binding -> 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