pygame   documentation
||  Home  ||  Help Contents  ||
 
|| pygame || cdrom || constants || cursor || display || draw ||
|| event || font || image || joystick || key || mixer ||
|| mixer_music || mouse || movie || sndarray || surfarray || time ||
|| transform ||
 
|| CD || Channel || Clock || Font || Joystick || Movie ||
|| Overlay || Rect || Sound || Surface ||
 
|| color || cursors || sprite ||

Movie

The Movie object represents an opened MPEG file. You control playback similar to a Sound object.
 
Movie objects have a target display Surface. The movie is rendered to this Surface in a background thread. If the Surface is the display surface, and the system supports it, the movie will render into a Hardware YUV overlay plane. If you don't set a display Surface, it will default to the display Surface.
 
Movies are played back in background threads, so there is very little management needed on the user end. Just load the Movie, set the destination, and Movie.play()
 
Movies will only playback audio if the pygame.mixer module is not initialized. It is easy to temporarily call pygame.mixer.quit() to disable audio, then create and play your movie. Finally calling pygame.mixer.init() again when finished with the Movie.
 
NOTE: When disabling the mixer so a movie may play audio, you must disable the audio before calling pygame.movie.Movie or the movie will not realise that it may access the audio. Before reinitialising the mixer, You must remove all references to the movie before calling pygame.mixer.init() or the init will fail, leading to errors when you attempt to use the mixer.
 
eg. pygame.mixer.quit() movie=pygame.movie.Movie(\"my.mpg\") movie.play() # process events until movie finished here movie.stop() movie=None # if you don't do this bit the init will fail pygame.mixer.init()
get_busy - query the playback state
get_busy - query the playback state
get_frame - query the current frame in the movie
get_frame - query the current frame in the movie
get_length - query playback time of the movie
get_length - query playback time of the movie
get_size - query the size of the video image
get_size - query the size of the video image
get_time - query the current time in the movie
get_time - query the current time in the movie
has_audio - query if movie stream has audio
has_audio - query if movie stream has audio
has_video - query if movie stream has video
has_video - query if movie stream has video
pause - pause/resume movie playback
pause - pause/resume movie playback
play - start movie playback
play - start movie playback
render_frame - Render a specfic numbered frame.
rewind - set playback position to the beginning of the movie
rewind - set playback position to the beginning of the movie
set_display - change the video output surface
set_display - change the video output surface
set_volume - change volume for sound
set_volume - change volume for sound
skip - skip the movie playback position forward
skip - skip ahead a given amount of time
stop - stop movie playback
stop - stop movie playback

get_busy
Movie.get_busy() -> bool
 
get_busy
Movie.get_busy() -> bool
 
get_frame
Movie.get_frame() -> int
 
get_frame
Movie.get_frame() -> int
 
get_length
Movie.get_length() -> float
 
get_length
Movie.get_length() -> float
 
get_size
Movie.get_size() -> width,height
 
get_size
Movie.get_size() -> width,height
 
get_time
Movie.get_time() -> float
 
get_time
Movie.get_time() -> float
 
has_audio
Movie.has_audio() -> bool
 
has_audio
Movie.has_audio() -> bool
 
has_video
Movie.has_video() -> bool
 
has_video
Movie.has_video() -> bool
 
pause
Movie.pause() -> None
 
pause
Movie.pause() -> None
 
play
Movie.play(loops=0) -> None
 
play
Movie.play() -> None
 
render_frame
Movie.render_frame(framenum) -> int
 
rewind
Movie.rewind() -> None
 
rewind
Movie.rewind() -> None
 
set_display
Movie.set_display(Surface, [pos]) -> None
 
set_display
Movie.set_display(Surface, [rect]) -> None
 
set_volume
Movie.set_volume(val) -> None
 
set_volume
Movie.set_volume(val) -> None
 
skip
Movie.skip(seconds) -> None
 
skip
Movie.skip(seconds) -> None
 
stop
Movie.stop() -> None
 
stop
Movie.stop() -> None