打开微信,使用扫一扫进入页面后,点击右上角菜单,
点击“发送给朋友”或“分享到朋友圈”完成分享
你好,我使用cnvideo系列的api解码RTSP实时视频流。
获取到avpacket后送入cnvideoDecInput:
memset(&_streamInfo, 0, sizeof(cnvideoDecInput));
if (!avPacket.data || avPacket.size <= 0 || eof) {
printf("receive null packet,notify stop decoding\n");
_streamInfo.streamBuf = nullptr;
_streamInfo.streamLength = 0;
_streamInfo.pts = 0;
_streamInfo.flags = CNVIDEODEC_FLAG_EOS;
} else {
_streamInfo.streamBuf = reinterpret_cast<u8_t *>(avPacket.data);
_streamInfo.streamLength = avPacket.size;
_streamInfo.pts = avPacket.pts;
_streamInfo.flags = CNVIDEODEC_FLAG_TIMESTAMP;//CNVIDEODEC_FLAG_END_OF_ ,CNVIDEODEC_FLAG_TIMESTAMP
}
ret = cnvideoDecFeedData(_handle, &_streamInfo, -1);//10000并在回调函数处理cncodec ,解码可以成功,并得到预期结果
-------------------------------------------------------------------------
当需要停止实时解码视频流,调用以下接口停止解码,在cnvideoDecStop报错:
cnvideoDecStop(_handle);
cnvideoDecDestroy(_handle);
错误信息:
[ERROR] - [CambriconCodec] cnvideoDecStop
[ERROR][CODEC-HAL][cnvideo_device.cpp:73(PollOutProc)]guid_=41 Poll returned error event, poll status(1).
[ERROR][CODEC-V4L2][cnvideo_v4l2_ioctl.c:940(SendStopCmd)]Failed to send stop command.
[ERROR][CODEC-HAL][cnvideo_device.cpp:313(AbortDevice)]thread poll_out_tid_ join error(Resource deadlock avoided)terminate called without an active exception
Aborted
希望能得到您的解答
热门帖子
精华帖子