VDEC Failure Due to Abnormal Streams
Symptom
hi_mpi_vdec_get_frame is called successfully, but a decoding failure (frame_info->v_frame.frame_flag = 1) is returned, because the input stream is abnormal or the configured stream format is inconsistent with the actual stream format.
Examples of common syntax parsing errors:
- Log example 1
pid 0 usr chn 0 device 0 chn 0, input stream error, can't decode, report to user
- Log example 2
ppssps_check_tmp_id: pps is null with this pic_parameter_set_id = 1 haven't decode
- Log example 3
PPS or SPS of this slice not valid
- Log example 4
sliceheader dec err
- Log example 5
H264DEC inquire_slice_property error
- Log example 6
hevc_inquire_slice_property error
- Log example 7
ref frame(poc 15) lost
- Log example 8
SH hevc_dec_short_term_ref_pic_set error
- Log example 9
p_temp_r_pset->num_negative_pics(66) out of range(0,15)
Possible Cause
frame_flag = 1 indicates that the decoding fails. The possible cause is that the input streams sent to the VDEC template are abnormal, or the streams are abnormal due to frame loss of broadcast packets caused by unstable network. As a result, an error is reported during decoding. In this case, you can save the input stream to check for any exception.
Solution
- After successfully calling hi_mpi_vdec_send_stream, write the input streams to a file as to save the streams. The reference code is as follows:
- Applicable to Ascend RC:
ret = hi_mpi_vdec_send_stream(chn, stream, vdec_pic_info, milli_sec); if (ret == HI_SUCCESS) { FILE *fd = NULL; fd = fopen("input_stream", "a+"); fwrite(stream->addr, stream->len, 1, fd); fclose(fd); }
- Applicable to Ascend EP:Transmit the stream data from the host to the device, and then send the decoded stream.
aclrtMemcpy(stream->addr, stream->len, buf, size, ACL_MEMCPY_HOST_TO_DEVICE); ret = hi_mpi_vdec_send_stream(chn, stream, vdec_pic_info, milli_sec); if (ret == HI_SUCCESS) { FILE *fd = NULL; fd = fopen("input_stream", "a+"); fwrite(buf, size, 1, fd); fclose(fd); }
- Applicable to Ascend RC:
- Use a third-party tool to view the saved input stream and check for any exception such as artifacts or error messages.
Parent topic: JPEGD and VDEC