Ren'Py is capable of using libav (included) to play movies using the video codecs:
and the following audio codecs:
inside the following container formats:
(Note that using some of these formats may require patent licenses. When in doubt, and especially for commercial games, we recommend using Theora, Vorbis, and Matroska or Ogg.)
Ren'Py expects that every movie will have an audio track associated with it, even if that audio track consists of nothing but silence. This is because the audio track is used for synchronization purposes.
Movies can be displayed fullscreen, or in a displayable. Fullscreen movies are the more efficient.
The easiest way to display a movie fullscreen is to display it using the renpy.movie_cutscene() function. This function displays a movie for a specified length of time. When that time has elapsed, or when the user clicks to dismiss the movie, the movie ends and the function returns.
$ renpy.movie_cutscene("On_Your_Mark.mpg")
This displays an MPEG-1 cutscene for the specified number of seconds. The user can click to interrupt the cutscene. Overlays and Underlays are disabled for the duration of the cutscene.
Returns True if the movie was terminated by the user, or False if the given delay elapsed uninterrupted.
A movie can also be displayed inside a displayable, allowing it to be combined with other things on the screen. To do this, one must first show a Movie displayable, and then play the movie on an audio channel. (We recommend using the movie channel for this purpose.)
init:
image movie = Movie(size=(400, 300), xalign=0.5, yalign=0.5)
label movie_sign:
scene black
show movie
play movie "incubus.mkv"
"Wow, this movie is really terrible."
"I mean, it stars William Shatner..."
"... speaking Esperanto."
"MAKE IT STOP!"
stop movie
hide movie
"Thats... better."
This is a displayable that shows the current movie.
The contents of this displayable when a movie is not playing are undefined. (And may change when a rollback occurs.)