ITPub博客

首页 > > > opencv videocapture 抓拍图片报警missing picture in acces

opencv videocapture 抓拍图片报警missing picture in acces

作者:amadan 时间:2019-10-18 14:35:59 0 删除 编辑

是通过Rtsp流地址抓拍的图片 运行一段时间后就会出现missing picture in access unit

有时候运行五分钟 有时候运行几个小时 望各位大佬拉小弟脱离此坑

int CaptureJpg(const string& curl)

{

if (curl.empty())

{

TextLog::Singleton().Write("log.log", "url empty");

return -1;

}

string ip;

GetIP(curl, ip);//从Rtsp流地址中获取ip

if (!ping(ip))//检测网络

{

TextLog::Singleton().Write("log.log", "Camera connection failed");

return -1;

}

cout<< curl < compression_params; compression_params.push_back(CV_IMWRITE_JPEG_QUALITY);//选择jpeg compression_params.push_back(30);//在这个填入你要的图片质量imwrite(fname.c_str(), frame, compression_params); DataCenter::Singlon().SetCameraljpg(fname); frame.release(); }cap.release();return0;

}

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2310/viewspace-3140926/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-06

  • 博文量
    200
  • 访问量
    14417