首先安装相关软件
sudo apt-get install vlc-bin vlc-plugin-base
pip3 install python-vlc
具体的Python调用播放代码
import vlc, time
instance = vlc.Instance("--aout=alsa")
player = instance.media_player_new()
video = instance.media_new("test.mp4")
player.set_media(video)
player.play()
time.sleep(10)
player.stop()
转载请注明:Linc Hu » 树莓派5 命令行播放视频