Defines the encoding parameters of a MovieWriter .
Public Member Functions
-
Format ()
-
getCodec () const
Returns the codec of type MovieWriter::Codec . Default is
Codec::H264
. -
Format &codec (Codec codec)
Sets the encoding codec. Default is
Codec::H264
. -
getFileType () const
Returns the output file type. Default is
FileType::QUICK_TIME_MOVIE
. -
Format &fileType (FileType fileType)
Sets the output file type, defined in MovieWriter::FileType . Default is
FileType::QUICK_TIME_MOVIE
. -
floatgetJpegQuality () const
Returns the overall quality for encoding in the range of [
0
,1.0
] for the JPEG codec. Defaults to0.99
.1.0
corresponds to lossless. -
Format &jpegQuality (float quality)
Sets the overall quality for encoding when using the JPEG codec. Must be in a range of [
0
,1.0
]. Defaults to0.99
.1.0
corresponds to lossless. -
floatgetDefaultFrameDuration () const
Returns the standard duration of a frame, measured in seconds. Defaults to
1/30
sec, meaning30
FPS. -
Format &defaultFrameDuration (float defaultDuration)
Sets the default duration of a frame, measured in seconds. Defaults to
1/30
sec, meaning30
FPS. -
longgetTimeScale () const
Returns the integer base value for the encoding time scale. Defaults to
600
. -
Format &setTimeScale (long timeScale)
Sets the integer base value for encoding time scale. Defaults to
600
. -
floatgetAverageBitsPerSecond () const
Returns the average bits per second for H.264 encoding. Defaults to no limit.
-
Format &averageBitsPerSecond (float avgBitsPerSecond)
Sets the average bits per second for H.264 encoding. Defaults to no limit.
-
voidunspecifyAverageBitsPerSecond ()
Resets the average bits per second to no limit.
-
boolisAverageBitsPerSecondSpecified () const
Returns whether the average bits per second for H.264 have been specified. If
false
, no limit is imposed. -
Format ()
-
Format (uint32_t codec, float quality)
-
Format (const ICMCompressionSessionOptionsRef settings, uint32_t codec, float quality, float frameRate, bool enableMultiPass)
-
Format (const Format &format)
-
~Format ()
-
const Format &operator= (const Format &format)
-
uint32_tgetCodec () const
Returns the four character code for the QuickTime codec. Types can be found in QuickTime's ImageCompression.h.
-
Format &setCodec (uint32_t codec)
Sets the four character code for the QuickTime codec. Defaults to
PNG
('png
'). Additional types can be found in QuickTime'sImageCompression.h
. -
floatgetQuality () const
Returns the overall quality for encoding in the range of [
0
,1.0
]. Defaults to0.99
.1.0
corresponds to lossless. -
Format &setQuality (float quality)
Sets the overall quality for encoding. Must be in a range of [
0
,1.0
]. Defaults to0.99
.1.0
corresponds to lossless. -
floatgetDefaultDuration () const
Returns the standard duration of a frame measured in seconds.
-
Format &setDefaultDuration (float defaultDuration)
Sets the default duration of a frame, measured in seconds. Defaults to
1/30
sec, meaning30
FPS. -
longgetTimeScale () const
Returns the integer base value for the encoding time scale. Defaults to
600
. -
Format &setTimeScale (long timeScale)
Sets the integer base value for encoding time scale. Defaults to
600
. -
floatgetGamma () const
Returns the gamma value by which image data is encoded.
-
Format &setGamma (float gamma)
Sets the gamma value by which image data is encoded. Defaults to
2.5
on MSW and2.2
on Mac OS X. -
boolisTemporal () const
Returns if temporal compression (allowing P or B frames) is enabled. Defaults to
true
. -
Format &enableTemporal (bool enable=true)
Enables temporal compression (allowing P or B frames). Defaults to
true
. -
boolisReordering () const
Returns if frame reordering is enabled. Defaults to
true
. In order to encode B frames, a compressor must reorder frames, which means that the order in which they will be emitted and stored (the decode order) is different from the order in which they were presented to the compressor (the display order). -
Format &enableReordering (bool enable=true)
Enables frame reordering. Defaults to
true
. In order to encode B frames, a compressor must reorder frames, which means that the order in which they will be emitted and stored (the decode order) is different from the order in which they were presented to the compressor (the display order). -
int32_tgetMaxKeyFrameRate () const
Gets the maximum number of frames between key frames. Default is
0
, which indicates that the compressor should choose where to place all key frames. Compressors are allowed to generate key frames more frequently if this would result in more efficient compression. -
Format &setMaxKeyFrameRate (int32_t rate)
Sets the maximum number of frames between key frames. Default is
0
, which indicates that the compressor should choose where to place all key frames. Compressors are allowed to generate key frames more frequently if this would result in more efficient compression. -
boolisFrameTimeChanges () const
Returns whether a codec is allowed to change frame times. Defaults to
true
. Some compressors are able to identify and coalesce runs of identical frames and output single frames with longer duration, or output frames at a different frame rate from the original. -
Format &enableFrameTimeChanges (bool enable=true)
Sets whether a codec is allowed to change frame times. Defaults to
true
. Some compressors are able to identify and coalesce runs of identical frames and output single frames with longer duration, or output frames at a different frame rate from the original. -
boolisMultiPass () const
Returns whether multiPass encoding is enabled. Defaults to
false
. -
Format &enableMultiPass (bool enable=true)
Enables multiPass encoding. Defaults to
false
. While multiPass encoding can result in significantly smaller movies, it often takes much longer to compress and requires the creation of two temporary files for storing intermediate results.