问题描述
- vs2010 opencv 不能播放视频?
-
这是书上的代码,编译能通过,就是视频不能播放?
也安装了XviD-1.1.3-27042008.
我用的是vs2010, opencv2.4.10
#include
#include
using namespace cv;
int main()
{
cv::VideoCapture capture("D:opencvbike.avi");
if(!capture.isOpened())
{
return 1;
}
double rate=capture.get(CV_CAP_PROP_FPS);
bool stop(false);
cv::Mat frame;
cv::namedWindow("Extracted Frame");
int delay=1000/rate;
while(!stop)
{
if(!capture.read(frame))
break;
cv::imshow("Extracted Frame",frame);
if(cv::waitKey(delay)>=0)
stop=true;
}
capture.release();
cv::waitKey(0);
system("pause");
return 0;}
输出结果是
“opencv2.exe”: 已加载“D:opencvopencv2Debugopencv2.exe”,已加载符号。
“opencv2.exe”: 已加载“C:WindowsSysWOW64ntdll.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64kernel32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64KernelBase.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“D:Program Filesopencvbuildx86vc10binopencv_core2410d.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64msvcp100d.dll”,已加载符号。
“opencv2.exe”: 已加载“C:WindowsSysWOW64msvcr100d.dll”,已加载符号。
“opencv2.exe”: 已加载“D:Program Filesopencvbuildx86vc10binopencv_highgui2410d.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64user32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64gdi32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64lpk.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64usp10.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64msvcrt.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64advapi32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64sechost.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64rpcrt4.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64sspicli.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64cryptbase.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64ole32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64oleaut32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:Windowswinsxsx86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18201_none_ec80f00e8593ece5comctl32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64avifil32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64winmm.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64msacm32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64msvfw32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64shell32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64shlwapi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64avicap32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64version.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64imm32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64msctf.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64nvinit.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:Program Files (x86)NVIDIA Corporationcoprocmanagerdetoured.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:Program Files (x86)NVIDIA CorporationcoprocmanagerNvd3d9wrap.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64setupapi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64cfgmgr32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64devobj.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:Program Files (x86)NVIDIA Corporationcoprocmanagernvdxgiwrap.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“D:Program Filesopencvbuildx86vc10binopencv_ffmpeg2410.dll”,未使用调试信息生成二进制文件。
“opencv2.exe”: 已加载“C:WindowsSysWOW64ws2_32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64nsi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64uxtheme.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“D:jinshan_weishiksafeksfmon.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:ProgramDataTencentTSVulFwTSVulFW.DAT”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64psapi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64clbcatq.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64apphelp.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64SogouPY.ime”,Cannot find or open the PDB file
“opencv2.exe”: 已卸载“C:WindowsSysWOW64SogouPY.ime”
“opencv2.exe”: 已加载“C:WindowsSysWOW64SogouPY.ime”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64msimg32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64oleacc.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64ntmarta.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64Wldap32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64dwmapi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“D:SogouInputComponentsPicFace1.0.0.1403PicFace.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:WindowsSysWOW64profapi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“D:SogouInput7.9.0.7504Resource.dll”,未使用调试信息生成二进制文件。
线程 'Win32 线程' (0x14ec) 已退出,返回值为 0 (0x0)。
线程 'Win32 线程' (0x1770) 已退出,返回值为 -1073741510 (0xc000013a)。
线程 'Win32 线程' (0xe34) 已退出,返回值为 -1073741510 (0xc000013a)。
线程 'Win32 线程' (0xf88) 已退出,返回值为 -1073741510 (0xc000013a)。
线程 'Win32 线程' (0x10c) 已退出,返回值为 -1073741510 (0xc000013a)。
线程 'Win32 线程' (0x1664) 已退出,返回值为 -1073741510 (0xc000013a)。
程序“[5932] opencv2.exe: 本机”已退出,返回值为 -1073741510 (0xc000013a)。
解决方案
安装配置有问题,建议仔细检查
解决方案二:
遇到同样的问题,请问你解决了吗
解决方案三:
if(!capture.read(frame))
break;
if那一行加断点,到了之后按F10往下走,应该是这里直接break出去了,也就是获得图像帧的时候失败了
解决方案四:
学着调试程序,上网搜f10的用法,知道程序在那一块出的问题,然后对症下药