UDN
Search public documentation:

FullScreenMovie
日本語訳
中国翻译
한국어

Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 Home > Matinee & Cinematics > Fullscreen Movie (FMV)
UE3 Home > Cinematic Artist > Fullscreen Movie (FMV)

Fullscreen Movie (FMV)


Overview


There are two methods for movie playback in UE3: using a MovieTexture resource with a material or using the Fullscreen movie player. This document discusses the features of the Fullscreen movie player.

Creating a new movie file


Please see the documentation provided by Rad Game Tools (http://radgametools.com/) for information on how to convert movies to the Bink format and for a list of the various encoding options that are available.

Playing a movie file


There are several ways of opening a movie file for playback. It can either be streamed directly from disk, preloaded into memory when first played, or it can use user-supplied memory which already has the movie stream loaded into it.

You can use the exec command "MOVIETEST " to test movie playback on any platform using a movie file. Note that the exec will block the game thread until the requested movie is finished before returning.

You can also use the global fullscreen movie player (GFullScreenMovie) to playback a movie from code. This global and its functions should only be accessed from the main game thread.

GameThreadPlayMovie - This function is used to start movie playback from a given filename. The playback method can be one of the following options:

name Description
MM_LoopFromStream stream and loop from disk, minimal memory usage
MM_PlayOnceFromStream stream from disk, minimal memory usage
MM_LoopFromMemory load movie into RAM and loop from there
MM_PlayOnceFromMemory load movie into RAM and play once
MM_LoopFromSuppliedMemory loop from previously loaded buffer
MM_PlayOnceFromSuppliedMemory play once from previously loaded buffer

If you specified a looping movie then playback will start over from the first frame in the movie stream and it will continue playing until you stop the movie. Note that you must always call GameThreadStopMovie after starting movie playback.

GameThreadIsMoviePlaying - This function checks to see if the given movie is currently playing.

GameThreadGetLastMovieName - This function returns the most recent movie which was last played.

Stoping a movie that is playing and blocking


GameThreadStopMovie - You must always call this function after calling GameThreadPlayMovie. This stops the currently playing movie and also removes the viewport that was created for movie playback.

GameThreadWaitForMovie - Calling this funciton will cause the game thread to block until movie playback is over. Note that if you do this on a looping movie you are blocking forever.

GameThreadIsMovieFinished - With this function you can check to see if a movie is still playing on the rendering thread. This allows you to do other work while playback occurs.

Config Settings


There are several options available which can be set in the [FullScreenMovie] section of your Game\Config\DefaultEngine.ini file.

  • "+StartupMovies=MovieName" - Adds MovieName to the list of startup movies. Startup movies are played in order until the entire sequence has been completed. The startup sequence is useful for hiding any initial loading occuring on the game thread while they are playing. The final movie in the list is reserved for a looping movie that can play as long as needed for the engine to boot up. If the engine boots before the movie before the final looping movie is done, then the looping movie is never played.
  • "+AlwaysLoadedMovies=MovieName" - Adds MovieName to the list of movies which stay resident in memory after their first playback. This is typically useful for the case of a loading movie which will always be needed during level transitions.
  • "+SkippableMovies=MovieName" - Adds MovieName to the list of movies which can be skipped. Skipping occurs when certain button presses are detected or when you manually try to stop a movie. This is useful for allowing some movies to be skipped after the engine has booted up (skipping movies will do nothing if the engine is still booting).
  • "+LoadMapMovies=MovieName" - An array of movies that are randomly chosen from at the start of UGameEngine::LoadMap to play during a blocking map load.
  • "bShouldStopMovieAtEndOfLoadMap" - If TRUE, when a blocking map load (via UGameEngine::LoadMap) completes, the engine will call StopMovie(). If FALSE, you will need to manually stop any movies that are playing (this is useful if you need to do some long processing after LoadMap completes).
  • "bForceNoMovies" - If TRUE, no movies will be played.

Movie playback Details


All movie playback is done on the rendering thread. If the rendering thread does not exist or has been stopped then the fullscreen movie player will manually start/stop the rendering thread when movie playback begins/ends. The fullscreen movie player is a tickable object on the rendering thread, but it only gets ticked when a movie is open and is being played.

A new viewport window is created for movie playback and it is destroyed when the movie is stopped. This is needed in order to handle input events properly.

The internal bink textures which are decoded to as well as the YUV->RGB conversion shaders are created when the first movie is played. This is the same implementation that is used for playback of the MovieTexture resources.