user2454108
user2454108

Reputation: 21

Pygame Error: Mpeg video will not play

picture block before sequence header block is the error I get when i try to play my mpeg video file in pygame.

i have no idea how to fix this:

global movie
movie = pygame.movie.Movie("movie.mpeg")
if movie.has_video():
    screen = pygame.display.set_mode(movie.get_size())
    movie_length = movie.get_length()
    movie.set_volume(0.99)
    movie.set_display(screen)
    movie.play()

This is all I have to play the movie. I believe this should play. Though the "picture block before sequence header block" error pops up.

What is wrong?

Upvotes: 2

Views: 2108

Answers (2)

Utkarsh Tiwari
Utkarsh Tiwari

Reputation: 145

Convert the video using ffmpeg.

To install ffmpeg follow this youtube video and link mentioned in it.

**https://www.youtube.com/watch?v=3lSb-jLEJ**JM

After installation convert the video using this command:-

ffmpeg -i input.mp4 -target ntsc-vcd -vcodec mpeg1video -an output.mpg

Upvotes: 1

Sapi
Sapi

Reputation: 1

I had this error myself, and I fixed it using ffmpeg and converting my .mpg video with this command:*

ffmpeg -i input.mp4 -target ntsc-vcd -vcodec mpeg1video -an output.mpg

* This answer was found on the Linux Distro Community forum.

Upvotes: 0

Related Questions