Pygame. Movie cannot be used in windows.
It seems that pymedia only supports python2.4, But not later versions ......
When playing a video file in Windows, you can only hear the sound. Go to the official website and check whether the video file can be played. However, it can be replaced by pymedia.
You can use a module to play titles, scenes, and other video images in the game.
To play music in a video, the pygame. Movie module must have full control over the audio interface and Cannot initialize the mixer module. Therefore, initialization must be completed in this way.
- Pygame. INIT ()
- Pygame. mixer. Quit ()
- Or only initialize pygame. display. INIT ()
- Movie = pygame. Movie. Movie ('filename') specifies the file name to load the video. The video format can be mpeg1. Instead of loading all video files to the memory immediately, the video files are loaded to the memory at during playback.
- Movie. set_display (pygame. display. set_mode (640,480) specifies the playing surface.
- Movie. set_volume (value) specifies the playback volume. The value range of the volume value is 0.0 to 1.0.
- Movie. Play () to play a video. This function returns immediately, and the video is played in the background. This function can contain the loops parameter to specify the number of repetitions. Video being played can be used
- Movie. Stop () to stop playing.
- Movie. Pause () pause playing.
- Movie. Skip (seconds) advances the video to seconds.
Note: In some xwindows, you may need to configure the environment variable: Export sdl_video_yuv_hwaccel = 0.