Class Description
It is used for video encoding by providing related open APIs.
For details about how to use this API, see Video Encoding.
- To ensure that resources are correctly reclaimed, you are advised to define and run VideoEncoder in the method of a function or class member. If VideoEncoder is defined in the global scope, use the del function to delete the constructed VideoEncoder object when the program ends.
Supported Models
Atlas inference product
- The VideoEncoder class involves resource allocation on the device, which conflicts with the scope of mx_deinit. Therefore, the scope of the VideoEncoder class must be smaller than the scope of mx_deinit.
- During encoder execution, a frame may fail to be encoded due to an excessively high transmission frequency, which may even exceed the processing speed of the chip. You are advised to control the frequency of calling the Encode API. For example, when the encoding frame rate is 30 fps, set the the interval for calling the Encode API within 33 ms.
- If a frame fails to be encoded, the encoder continues to process subsequent frames. You can learn that the frame encoding result is not obtained based on the frame ID in the callback function.
Parent topic: VideoEncoder