moviePtr =
Screen('
CreateMovie', windowPtr, movieFile
[, width
][, height
][, frameRate=
30][, movieOptions
]);
Create a new movie file with filename 'movieFile' and according to given
'movieOptions'.
The function returns a handle 'moviePtr' to the file.
On OS/X and on MS-Windows with Matlab versions prior to R2007a, Apple Quicktime
is used for movie writing. On GNU/Linux and on MS-Windows with recent versions
of Matlab or GNU/Octave, the GStreamer multimedia framework is used for movie
writing. GStreamer is generally more advanced and offers more functionality.
Currently only single-track video encoding is supported. Audio encoding is not
supported on OS/X.
See '
Screen AddAudioBufferToMovie?' on how to add audio tracks to movies via
GStreamer.
Movie creation is a 3 step procedure:
1. Create a movie and define encoding options via '
CreateMovie'.
2. Add video and audio data to the movie via calls to '
AddFrameToMovie' et al.
3. Finalize and close the movie via a call to '
FinalizeMovie'.
All following parameters are optional and have reasonable defaults:
'width' Width of movie video frames in pixels. Defaults to width of window
'windowPtr'.
'height' Height of movie video frames in pixels. Defaults to height of window
'windowPtr'.
'frameRate' Playback framerate of movie. Defaults to 30 fps. Technically this is
not the playback framerate but the granularity in 1/frameRate seconds with which
the duration of a single movie frame can be specified. When you call
'
AddFrameToMovie', there's an optional parameter 'frameDuration' which defaults
to one. The parameter defines the display duration of that frame as the fraction
'frameDuration' / 'frameRate' seconds, so 'frameRate' defines the denominator of
that term. However, for a default 'frameDuration' of one, this is equivalent to
the 'frameRate' of the movie, at least if you leave everything at defaults.
'movieoptions' a textstring which allows to define additional parameters via
keyword=parm pairs. For GStreamer movie writing, you can provide the same
options as for GStreamer video recording. See 'help
VideoRecording' for
supported options and tips.
Keywords unknown to a certain implementation or codec will be silently ignored:
EncodingQuality=x Set encoding quality to value x, in the range 0.0 for lowest
movie quality to 1.0 for highest quality. Default is 0.5 = normal quality. 1.0
usually provides lossless encoding.
On systems with Quicktime movie writing, codecs can be selected by FOURCC codes.
This is not supported on GStreamer setups for now:
CodecFOURCCId=id FOURCC id. The FOURCC of a desired video codec as a number.
Defaults to H.264 codec.
Choice of codec and quality defines a tradeoff between filesize, quality,
processing demand and speed, as well as on which target devices you'll be able
to play your movie.
CodecFOURCC=xxxx FOURCC as a four character text string instead of a number.