load an mpeg movie file
pygame.movie.Movie(filename): return Movie pygame.movie.Movie(object): return Movie
Load a new MPEG movie stream from a file or a python file object. The Movie object operates similar to the Sound objects from pygame.mixer.
Movie objects have a target display Surface. The movie is rendered into this Surface in a background thread. If the target Surface is the display Surface, the movie will try to use the hardware accelerated video overlay. The default target is the display Surface.
start playback of a movie
Movie.play(loops=0): return None
Starts playback of the movie. Sound and video will begin playing if they are not disabled. The optional loops argument controls how many times the movie will be repeated. A loop value of -1 means the movie will repeat forever.
stop movie playback
Movie.stop(): return None
Stops the playback of a movie. The video and audio playback will be stopped at their current position.
temporarily stop and resume playback
Movie.pause(): return None
This will temporarily stop or restart movie playback.
advance the movie playback position
Movie.skip(seconds): return None
Advance the movie playback time in seconds. This can be called before the movie is played to set the starting playback time. This can only skip the movie forward, not backwards. The argument is a floating point number.
restart the movie playback
Movie.rewind(): return None
Sets the movie playback position to the start of the movie. The movie will automatically begin playing even if it stopped.
The can raise a ValueError if the movie cannot be rewound. If the rewind fails the movie object is considered invalid.
set the current video frame
Movie.render_frame(frame_number): return frame_number
This takes an integer frame number to render. It attempts to render the given frame from the movie to the target Surface. It returns the real frame number that got rendered.
get the current video frame
Movie.get_frame(): return frame_number
Returns the integer frame number of the current video frame.
get the current vide playback time
Movie.get_time(): return seconds
Return the current playback time as a floating point value in seconds. This method currently seems broken and always returns 0.0.
check if the movie is currently playing
Movie.get_busy(): return bool
Returns true if the movie is currently being played.
the total length of the movie in seconds
Movie.get_length(): return seconds
Returns the length of the movie in seconds as a floating point value.
get the resolution of the video
Movie.get_size(): return (width, height)
Gets the resolution of the movie video. The movie will be stretched to the size of any Surface, but this will report the natural video size.
check if the movie file contains video
Movie.get_video(): return bool
True when the opened movie file contains a video stream.
check if the movie file contains audio
Movie.get_audio(): return bool
True when the opened movie file contains an audio stream.
set the audio playback volume
Movie.set_volume(value): return None
Set the playback volume for this movie. The argument is a value between 0.0 and 1.0. If the volume is set to 0 the movie audio will not be decoded.
set the video target Surface
Movie.set_display(Surface, rect=None): return None
Set the output target Surface for the movie video. You may also pass a rectangle argument for the position, which will move and stretch the video into the given area.
If None is passed as the target Surface, the video decoding will be disabled.