pyglet.media.codecs.wave.WAVEFormatException: file does not start with RIFF id

it says something about not having a wave format .wav do work but i need videos to work and open cv is not a option

ive tryed adding avbin64 to all the recemended files like system system64WOW resours file ext. ive tryed turning the .mp4 into .avi tryed a differnd video

import pyglet
pyglet.resource.path = ['C:\\Users\\Gebruiker\\PycharmProjects\\project1 \\res']
pyglet.resource.reindex()
vid = ('file_example_MP4_480_1_5MG.mp4')
vidpath = pyglet.resource.media(vid)
window = pyglet.window.Window()
player = pyglet.media.Player()
source = pyglet.media.StreamingSource()
MediaLoad = pyglet.media.load(vidPath)
#player.queue(MediaLoad)
#player.play()
@window.event
def on_draw(): window.clear() if player.source and player.source.video_format: player.get_texture().blit(50,50) player.draw() pyglet.app.run()

error code:

Traceback (most recent call last): File "C:/Users/Gebruiker/PycharmProjects/project1/venv/test", line 7, in <module> vidpath = pyglet.resource.media(vid) File "C:\Users\Gebruiker\PycharmProjects\project1\venv\lib\site-packages\pyglet\resource.py", line 678, in media return media.load(path, streaming=streaming) File "C:\Users\Gebruiker\PycharmProjects\project1\venv\lib\site-packages\pyglet\media\__init__.py", line 133, in load loaded_source = decoder.decode(file, filename, streaming) File "C:\Users\Gebruiker\PycharmProjects\project1\venv\lib\site-packages\pyglet\media\codecs\wave.py", line 109, in decode return WaveSource(filename, file) File "C:\Users\Gebruiker\PycharmProjects\project1\venv\lib\site-packages\pyglet\media\codecs\wave.py", line 61, in __init__ raise WAVEFormatException(e)
pyglet.media.codecs.wave.WAVEFormatException: file does not start with RIFF id

hoped that the video would play

1 Answer

pyglet.media.codecs.wave.WAVEFormatException: file does not start with RIFF id

This error occurred because you are using version 1.4.4 of pyglet. You can solve this issue by downgrading to version 1.3.2

pip install pyglet==1.3.2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like