RV1126下,用C++ opencv 打开rtsp视频流获取图像帧
- 程序执行一段时间后,程序报错,获取到的图像帧为空,报错信息如下:
[h264 @ 0x1f5690] cabac decode of qscale diff failed at 91 56
[h264 @ 0x1f5690] error while decoding MB 91 56, bytestream -5
目前还没有找到解决办法,只能在每次图像帧为空时,重新打开视频流
if(cur_frame.empty()){
coutRed("[ERROR][detection.cpp][detectYolov5RknnUchar] The frame is empty.");
// break;
sprintf(info, "[INFO][detection.cpp][detectYolov5RknnUchar] Reopening %s ......", rtsp_url.c_str());
coutGreen(info);
capture.open(rtsp_url);
if(!capture.isOpened()){
coutRed("[ERROR][detection.cpp][detectYolov5RknnUchar] Failed to open the rtsp video stream: " + rtsp_url);
return "ERROR";
}
continue;
}
有好的解决方法的大佬求教……