import pyglet
window = pyglet.window.Window()
player = pyglet.media.Player()
source = pyglet.media.load('E:\\FFOutput\\a5.mp4')
player.queue(source)
player.play()
@window.event
def on_draw():
image=player.get_texture()
if image is not None:
image.blit(0, 0)
pyglet.app.run()
报的错是BUS ERROR
>>> %Run test.py
Backend terminated or disconnected.Fatal Python error: Bus error
Thread 0xafd4f460 (most recent call first):
File "/usr/lib/python3/dist-packages/gi/overrides/GLib.py", line 498 in run
File "/usr/local/lib/python3.7/dist-packages/pyglet/media/codecs/gstreamer.py", line 66 in run
File "/usr/lib/python3.7/threading.py", line 917 in _bootstrap_inner
File "/usr/lib/python3.7/threading.py", line 885 in _bootstrap
Current thread 0xb6f1ead0 (most recent call first):
File "/usr/local/lib/python3.7/dist-packages/pyglet/media/codecs/ffmpeg.py", line 944 in _ffmpeg_decode_video
File "/usr/local/lib/python3.7/dist-packages/pyglet/media/codecs/ffmpeg.py", line 886 in _decode_video_packet
File "/usr/local/lib/python3.7/dist-packages/pyglet/media/codecs/ffmpeg.py", line 962 in get_next_video_timestamp
File "/usr/local/lib/python3.7/dist-packages/pyglet/media/player.py", line 463 in update_texture
File "/usr/local/lib/python3.7/dist-packages/pyglet/clock.py", line 292 in call_scheduled_functions
File "/usr/local/lib/python3.7/dist-packages/pyglet/app/base.py", line 239 in idle
File "/usr/local/lib/python3.7/dist-packages/pyglet/app/base.py", line 169 in run
File "/usr/local/lib/python3.7/dist-packages/pyglet/app/__init__.py", line 107 in run
File "/home/pi/python/test.py", line 14 in <module>
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1272 in _execute_prepared_user_code
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1200 in wrapper
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1213 in wrapper
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 1259 in execute_source
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 815 in _execute_source
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 801 in _execute_file
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 403 in _cmd_Run
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 204 in handle_command
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 146 in mainloop
File "/usr/lib/python3/dist-packages/thonny/backend_launcher.py", line 87 in <module> Use 'Stop/Restart' to restart.