c++ - VideoCapture.Open 失败
问题描述
它总是无法打开并打印出里面的东西if (!capVideo.isOpened())
,是的,我确定路径是正确的
cv::VideoCapture capVideo;
capVideo.open("C:\\Users\\Eren\\Desktop\\vid.mp4");
if (!capVideo.isOpened()) { // if unable to open video file
std::cout << "error reading video file" << std::endl << std::endl;
capVideo.open("C:\\Users\\Eren\\Desktop\\vid.mp4");// show error message
_getch(); // it may be necessary to change or remove this line if not using Windows
return(0); // and exit program
}
解决方案
推荐阅读
- php - Wordpress - 如果类别不匹配,则不显示任何帖子
- url - 如何通过 PWA 方式强制在 Android 设备的主屏幕上创建网站快捷方式
- python - 重命名列表中的项目并使用下一个和上一个按钮转到另一个项目,但将重命名的项目保留在列表中
- swift - 查询搜索 Swift
- javascript - 单行内联注释前空格的 ESLint 规则
- swift - 如何在 SideMenu Swift 中添加边框作为分隔符?
- android - PWABuilder - Android 商店包问题
- machine-learning - 与默认模型相比,XGBoost 超调参数的精度较低
- ios - 单行 UILabel - 基线位置错误
- .net-core - AutoMapper:映射到字典时出现“仅对类型的顶级个人成员支持成员的自定义配置”错误