API Description
The
Developers can inherit the VideoEncoder class and implement the APIs according to the description in this section. In addition, CreateVideoEncoder and DestroyVideoEncoder are provided for creating specific instances of this implementation class.
The return codes are defined as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 | enum EncoderRetCode : uint32_t { VIDEO_ENCODER_SUCCESS = 0x00, VIDEO_ENCODER_CREATE_FAIL = 0x01, // Failed to create an encoder. VIDEO_ENCODER_INIT_FAIL = 0x02, // Failed to initialize the encoder. VIDEO_ENCODER_START_FAIL = 0x03, // Failed to start the encoder. VIDEO_ENCODER_ENCODE_FAIL = 0x04, // Failed to encode data. VIDEO_ENCODER_STOP_FAIL = 0x05, // Failed to stop the encoder. VIDEO_ENCODER_DESTROY_FAIL = 0x06, // Failed to destroy the encoder. VIDEO_ENCODER_REGISTER_FAIL = 0x07, // Failed to register the function with the encoder. VIDEO_ENCODER_RESET_FAIL = 0x08, // Failed to reset the encoder. VIDEO_ENCODER_FORCE_KEY_FRAME_FAIL = 0x09, // Failed to set the forcible I-frame encoding mode. VIDEO_ENCODER_SET_ENCODE_PARAMS_FAIL = 0x0A // Failed to set encoding parameters. }; |
The encoder types are defined as follows:
1 2 3 4 5 6 7 8 9 10 11 | enum EncoderFormat: uint32_t { ENCODER_TYPE_OPENH264 = 0, // Open-source OpenH264 encoder ENCODER_TYPE_NETINTH264 = 1, // NETINT H.264 hardware encoder ENCODER_TYPE_NETINTH265 = 2, // NETINT H.265 hardware encoder ENCODER_TYPE_VASTAIH264 = 3, // VASTAI H.264 hardware encoder ENCODER_TYPE_VASTAIH265 = 4, // VASTAI H.265 hardware encoder ENCODER_TYPE_QUADRAH264 = 5, // QUADRA H.264 hardware encoder ENCODER_TYPE_QUADRAH265 = 6, // QUADRA H.265 hardware encoder ENCODER_TYPE_T432H264 = 7, // T432 H.264 hardware encoder ENCODER_TYPE_T432H265 = 8, // T432 H.265 hardware encoder }; |
Parent topic: Encoding APIs (C and C++)