Problem in opening the video files using Open CV
Hi Everyone,
I'm unable to open the video files using this code... Please do have a look at it, I tried on various video clips like .avi, .mov etc...
Here is the code:
#include "F:\opencv243\include\opencv2\opencv.hpp"
#include "F:\opencv243\include\opencv\stdafx.h"
#include "F:\opencv243\build\include\opencv2\core\core.hpp"
#include "F:\opencv243\build\include\opencv2\imgproc\imgproc.hpp"
#include "F:\opencv243\build\include\opencv2\highgui\highgui.hpp"
#include "iostream"
#include "vector"
#include "stdio.h"
int main()
{
// Open the video file
cv::VideoCapture capture("F:\Bee videos\P1040356.mov");
// check if video successfully opened
if (!capture.isOpened())
return 1;
// Get the frame rate
double rate= capture.get(CV_CAP_PROP_FPS);
bool stop(false);
cv::Mat frame; // current video frame
cv::namedWindow("Extracted Frame");
// Delay between each frame
// corresponds to video frame rate
int delay= 1000/rate;
// for all frames in video
while (!stop) {
// read next frame if any
if (!capture.read(frame))
break;
cv::imshow("Extracted Frame",frame);
// introduce a delay
// or press key to stop
if (cv::waitKey(delay)>=0)
stop= true;
}
// Close the video file
capture.release();
}
Code is ok with build but for debugging, if shows the following:
'Video frames try.exe': Loaded 'F:\opencv243\Projects\Video frames try\Debug\Video frames try.exe', Symbols loaded.
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'F:\opencv243\build\x86\vc10\bin\opencv_core243d.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
'Video frames try.exe': Loaded 'F:\opencv243\build\x86\vc10\bin\opencv_highgui243d.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'Video ...