2 huaweigang123 huaweigang123 于 2016.03.13 19:37 提问

vs2010 opencv 不能播放视频?

这是书上的代码,编译能通过,就是视频不能播放?
也安装了XviD-1.1.3-27042008.
我用的是vs2010, opencv2.4.10
#include
#include
using namespace cv;
int main()
{
cv::VideoCapture capture("D:\opencv\bike.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:\opencv\opencv2\Debug\opencv2.exe”,已加载符号。
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\ntdll.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\kernel32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\KernelBase.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“D:\Program Files\opencv\build\x86\vc10\bin\opencv_core2410d.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\msvcp100d.dll”,已加载符号。
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\msvcr100d.dll”,已加载符号。
“opencv2.exe”: 已加载“D:\Program Files\opencv\build\x86\vc10\bin\opencv_highgui2410d.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\user32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\gdi32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\lpk.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\usp10.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\msvcrt.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\advapi32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\sechost.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\rpcrt4.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\sspicli.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\cryptbase.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\ole32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\oleaut32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18201_none_ec80f00e8593ece5\comctl32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\avifil32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\winmm.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\msacm32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\msvfw32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\shell32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\shlwapi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\avicap32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\version.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\imm32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\msctf.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\nvinit.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\detoured.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\Nvd3d9wrap.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\setupapi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\cfgmgr32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\devobj.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\nvdxgiwrap.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“D:\Program Files\opencv\build\x86\vc10\bin\opencv_ffmpeg2410.dll”,未使用调试信息生成二进制文件。
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\ws2_32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\nsi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\uxtheme.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“D:\jinshan_weishi\ksafe\ksfmon.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\ProgramData\Tencent\TSVulFw\TSVulFW.DAT”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\psapi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\clbcatq.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\apphelp.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\SogouPY.ime”,Cannot find or open the PDB file
“opencv2.exe”: 已卸载“C:\Windows\SysWOW64\SogouPY.ime”
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\SogouPY.ime”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\msimg32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\oleacc.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\ntmarta.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\Wldap32.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\dwmapi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“D:\SogouInput\Components\PicFace\1.0.0.1403\PicFace.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“C:\Windows\SysWOW64\profapi.dll”,Cannot find or open the PDB file
“opencv2.exe”: 已加载“D:\SogouInput\7.9.0.7504\Resource.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)。

4个回答

luoshixian099
luoshixian099   2016.03.14 08:39

安装配置有问题,建议仔细检查

adelally
adelally   2016.04.05 10:17

遇到同样的问题,请问你解决了吗

lx624909677
lx624909677   Ds   Rxr 2016.04.05 10:21

if(!capture.read(frame))
break;
if那一行加断点,到了之后按F10往下走,应该是这里直接break出去了,也就是获得图像帧的时候失败了

qq_27359637
qq_27359637   2016.05.05 00:22

学着调试程序,上网搜f10的用法,知道程序在那一块出的问题,然后对症下药

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!