×

签到

分享到微信

打开微信,使用扫一扫进入页面后,点击右上角菜单,

点击“发送给朋友”或“分享到朋友圈”完成分享

解码流媒体过程中cnvideoDecStop报错 已解决 xukefang2022-06-22 15:33:05 回复 4 查看 技术答疑 使用求助
解码流媒体过程中cnvideoDecStop报错
分享到:

你好,我使用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



希望能得到您的解答

版权所有 © 2024 寒武纪 Cambricon.com 备案/许可证号:京ICP备17003415号-1
关闭