ret = mpp_enc_data.mpi->encode_put_frame(mpp_enc_data.ctx, frame);
if (ret)
{
printf("mpp encode put frame failed\n");
mpp_frame_deinit(&frame);
return -1;
}
ret = mpp_enc_data.mpi->encode_get_packet(mpp_enc_data.ctx, &packet);
if (ret)
{
printf("mpp encode get packet failed\n");
mpp_frame_deinit(&frame);
mpp_packet_deinit(&packet);
return -1;
}
其中函数encode_put_frame()返回错误:
mpp: put_frame poll on set timeout 0 ret -1
mpp encode put frame failed
mpp: put_frame poll on set timeout 0 ret -1
mpp encode put frame failed
mpp: put_frame poll on set timeout 0 ret -1
mpp encode put frame failed
mpp: put_frame poll on set timeout 0 ret -1
mpp encode put frame failed
mpp: put_frame poll on set timeout 0 ret -1
mpp encode put frame failed
mpp: put_frame poll on set timeout 0 ret -1
mpp encode put frame failed
mpp: put_frame poll on set timeout 0 ret -1
mpp encode put frame failed
mpp: put_frame poll on set timeout 0 ret -1
该错误每隔几秒钟出现一次,且没有规律,编码出来的视频数据出现缺帧现象。
测试编码1080P,720P,480P都会出现以上问题,请问如何解决该问题?
在Linux 平台下进行H264 硬编码,调用mpp函数流程如下: mpp_frame_set_width(frame, mpp_enc_data.width); mpp_frame_set_height(frame, mpp_enc_data.height); mpp_frame_set_hor_stride(frame, mpp_enc_data.hor_stride); mpp_frame_set_ver_stride(frame, mpp_enc_data.ver_stride); mpp_frame_set_fmt(frame, mpp_enc_data.fmt); mpp_frame_set_buffer(frame, mpp_enc_data.frm_buf); mpp_frame_set_eos(frame, mpp_enc_data.frm_eos);
其中函数encode_put_frame()返回错误: mpp: put_frame poll on set timeout 0 ret -1 mpp encode put frame failed mpp: put_frame poll on set timeout 0 ret -1 mpp encode put frame failed mpp: put_frame poll on set timeout 0 ret -1 mpp encode put frame failed mpp: put_frame poll on set timeout 0 ret -1 mpp encode put frame failed mpp: put_frame poll on set timeout 0 ret -1 mpp encode put frame failed mpp: put_frame poll on set timeout 0 ret -1 mpp encode put frame failed mpp: put_frame poll on set timeout 0 ret -1 mpp encode put frame failed mpp: put_frame poll on set timeout 0 ret -1 该错误每隔几秒钟出现一次,且没有规律,编码出来的视频数据出现缺帧现象。 测试编码1080P,720P,480P都会出现以上问题,请问如何解决该问题?