MovieWriter
An interface for recording rendered project frames and audio.
MovieWriter serves Movie Maker: fixed simulation timing and recording project images and audio. It does not capture the desktop and is not an ordinary gameplay recorder. Select recording before running the project through editor settings or --write-movie.
The tested editor build writes OGV (Theora/Vorbis), AVI (MJPEG/PCM), and a PNG sequence with a separate PCM WAV. Duration follows frame count and FPS. A working graphics renderer is required; --headless with the dummy renderer cannot supply these frames. Quit normally so the container and indices are finalized. Format availability depends on the modules in a particular build.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
MovieWriterConstructor
public MovieWriter();Methods7
AddWritervoid
public static void AddWriter(MovieWriter writer);Adds a writer to be usable by the engine. The supported file extensions can be set by overriding MovieWriter._HandlesFile.
Note: MovieWriter.AddWriter must be called early enough in the engine initialization to work, as movie writing is designed to start at the same time as the rest of the engine.
| Name | Type | Default |
|---|---|---|
writer | MovieWriter | — |
_GetAudioMixRateuint
public virtual uint _GetAudioMixRate();Called when the audio sample rate used for recording the audio is requested by the engine. The value returned must be specified in Hz. Defaults to 48000 Hz if MovieWriter._GetAudioMixRate is not overridden.
uint_GetAudioSpeakerModeAudioServer.SpeakerMode
public virtual AudioServer.SpeakerMode _GetAudioSpeakerMode();Called when the audio speaker mode used for recording the audio is requested by the engine. This can affect the number of output channels in the resulting audio file/stream. Defaults to AudioServer.SpeakerMode.ModeStereo if MovieWriter._GetAudioSpeakerMode is not overridden.
AudioServer.SpeakerMode_GetSupportedExtensionsstring[]
public virtual string[] _GetSupportedExtensions();Returns the list of supported filename extensions for movies written with this MovieWriter.
string[]_HandlesFilebool
public virtual bool _HandlesFile(string path);Called when the engine determines whether this MovieWriter is able to handle the file at path. Must return true if this MovieWriter is able to handle the given file path, false otherwise. Typically, MovieWriter._HandlesFile is overridden as follows to allow the user to record a file at any path with a given file extension:
| Name | Type | Default |
|---|---|---|
path | string | — |
bool_WriteBeginError
public virtual Error _WriteBegin(Vector2I movieSize, uint fps, string basePath);Called once before recording. movieSize is the output frame size in pixels, fps is the frame rate, and basePath is the selected path. Return Error.Ok after successfully opening resources. Validate dimensions, directory access and your format's limits.
| Name | Type | Default |
|---|---|---|
movieSize | Vector2I | — |
fps | uint | — |
basePath | string | — |
Error_WriteEndvoid
public virtual void _WriteEnd();Called when recording ends normally. Implementations must close files and finalize container data, indices and sizes. Forcefully terminating the process does not guarantee this callback; use normal closure or EntityTree.Quit().