4

I'm trying to play a video as a cutscene for my game that i developed using pygame. I want to play the video through my pygame window. I have tried cv2 but apparently that only displays video and no audio so I moved onto ffpyplayer but now it just plays the audio and doesn't show any video frames at all. I can see that the code is reading the frames but not displaying them. This is the code I'm using to play my mp4 videos:

def playVid(filename):
    from ffpyplayer.player import MediaPlayer
    import time
    player = MediaPlayer(filename)
    val = ''
    while val != 'eof':
        frame, val = player.get_frame()
        if val != 'eof' and frame is not None:
            img, t = frame
            # display img
Moe
  • 191
  • 7
  • [This](https://stackoverflow.com/questions/59611075/how-would-i-go-about-playing-a-video-stream-with-ffpyplayer/59628167#59628167) might help you. – Vencat Jan 07 '20 at 12:14

0 Answers0