如何使用python3.7在Raspberry Pi 3b上播放视频?我试过下面的代码,这在桌面上工作,但在pi上它给了我一个神秘的“总线错误”问题。尝试使用try-catch块打印更多信息,但没有打印任何内容
import pyglet
import traceback
pyglet.have_avbin = True
pyglet.options['search_local_libs'] = True
vidPath = "sample1.mp4"
exc_obj=None
window = pyglet.window.Window(width=500, height=500)
player = pyglet.media.Player()
player.volume = 0
source = pyglet.media.StreamingSource()
try:
mediaLoad = pyglet.media.load(vidPath)
player.queue(mediaLoad)
player.play()
except Exception as exc:
tb = traceback.TracebackException.from_exception(exc)
print(''.join(tb.stack.format()))
@window.event
def on_draw():
if player.source and player.source.video_format:
player.get_texture().blit(0, 0)
pyglet.app.run()
是否有其他库可以用来实现相同的或任何其他方式来修复此错误。 如果需要,我可以将硬件更改为3b+或4。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐