Ascend 310 acldvpp API |
Ascend 310P hi_mpi API |
What You Need to Do |
|---|---|---|
Call the aclrtSynchronizeStream API, and obtain the encoding result after the image encoding is complete. The address of encoded images is the output buffer address passed to the acldvppJpegEncodeAsync API. The image size is obtained from the output of size of the acldvppJpegEncodeAsync call. |
Obtain the encoding result of a frame using hi_mpi_venc_get_stream, and then obtain the encoded data from the following members of the hi_venc_stream struct: hi_venc_stream.pack[i].addr hi_venc_stream.pack[i].len hi_venc_stream.pack[i].data_type (obtain the output image format from this member struct) hi_venc_stream.pack[i].pts |
Modify your code to start another thread and call the hi_mpi_venc_get_stream API to proactively obtain the encoding result. Note to obtain the number of encoded packets (n) using hi_mpi_venc_query_status. Before calling hi_mpi_venc_get_stream, allocate memory whose size must be at least n times sizeof(hi_venc_pack) to the hi_venc_stream.pack parameter. After the encoding result is obtained successfully, call the hi_mpi_venc_release_stream API to release the stream buffer. |
No corresponding API. The encoder does not need to be instructed to stop receiving data frames to be encoded. |
Notify the encoder of stopping receiving input data (the API needs to be called only once per channel): hi_mpi_venc_stop_chn |
Add the hi_mpi_venc_stop_chn API call in your code. |