The Ultimotion Matinee encoder object provides methods to compress video frames to the Ultimotion Matinee video format. It is presented in the class library for editing and format-conversion purposes. The object permits compression based on a quality factor. The latter can be used over a series of frames to control the average data rate.
To learn more about the UMSUMEncoder object, see:
For introductory information, see Video Codec Objects.
To avoid name collision on defines, integer values have been captured as enumerated lists. The set of valid values from an enumerated list can vary with the application. The detailed method descriptions describe the valid or possible values for the specific use. The enumerated lists that are defined for this object are:
enum ReturnCode { Success, Failure, UnsupportedFormat, UnsupportedAlgorithm, OutOfRange, Uninitialized, OutOfMemory, InvalidQualityFactor };
enum ImageFormat { YUV9, RGB24 };
enum AlgorithmType { Symmetric, Asymmetric };
enum FrameType { IFrame, DFrame };
The UMSUMEncoder object defines the following type definitions:
This method compresses an input image into an Ultimotion Matinee compression format. The desired length value (in bytes) is used to control the expected bit rate of the algorithm. The actual buffer size allocated should be larger than this desired length. You can call the get_max_buffer_size method before compressing a frame to determine the worst-case buffer size requirements. The initial quality factor determines the starting point for the compression algorithm. By checking the returned quality factor and using a value that is slightly higher (higher quality) on subsequent calls, the frame compression time can be reduced. I frames are somewhat larger than delta frames and the desired length should be adjusted depending on the frame type requested.
This method compresses an input image into an Ultimotion Matinee compression format. It uses the quality factor to control the amount of compression applied to the input data. You can call the get_max_buffer_size method before compressing a frame to determine the worst-case buffer size requirements. The frame_type variable can be used to specify whether the image is to be compressed as an I frame or delta frame. Each movie sequence must begin with an I frame.
This method enables the application to query the setting of the encoder algorithm.
AlgorithmType | Possible values are Symmetric and Asymmetric. |
This method enables the application to query the state of the input image format setting in the encoder.
This method enables the application to query the settings for the input image size for the encoder.
inout long width | Current setting of the x dimension. |
inout long height | Current setting of the y dimension. |
The encoder calculates and returns a worst-case buffer size. You can use this value to determine the required size of the compressed image buffer.
Specifies the maximum possible encoded image size in bytes, independent of quality or bit-rate settings.
This method enables the application to determine the settings for the subimage dimensions for the encoder.
This method selects one of two possible encoding algorithms. The asymmetric format provides the highest quality encoding format. Currently, this is the only supported format.
in AlgorithmType algorithm_type | Possible values are Symmetric and Asymmetric. |
This method sets the format of the input image data frames that the encoder accepts.
in ImageFormatIn ulti_image_format | Possible values are YUV9 and RGB24. |
A raster scan of 4 x 4 pixel regions, in which each region is of the format:
Y1, Y2, Y3, ..., Y16, U, V, (each element an 8-bit value)
The spatial region is defined as follows, where U and V represent average values over the 4x4 pixel region:
Y1 Y2 Y3 Y4 Y5 Y6 .... .............. Y13 Y14 Y15 Y16
A raster scan of pixels, in which each 32-bit pixel is in the following form:
Overlay : Red : Green : Blue (8 bits per color component)
This method enables the application to specify the dimensions of the input image frame. The encoder truncates these to multiples of 8 by extracting a subimage starting at the upper left of the image.
in long width | Number of pixels in the x dimension. |
in long height | Number of pixels in the y dimension. |
This method enables a subimage within an image to be compressed. It does not need to be called if the full image is to be encoded. The offsets must be positive integer values, and the width and height must each be a multiple of 8. The set_image_size method must also be called to specify the actual input image size. The offsets are measured from the upper left corner of the original image (right is positive x, down is positive y).
For introductory information, see Video Codec Objects.