Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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 frames try.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common- controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\avifil32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\msacm32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\msvfw32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\avicap32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'F:\opencv243\build\x86\vc10\bin\opencv_ffmpeg243.dll', Binary was not built with debug information.

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\wsock32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file The program '[6268] Video frames try.exe: Native' has exited with code 1 (0x1).

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"

#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 frames try.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common- controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\avifil32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\msacm32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\msvfw32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\avicap32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'F:\opencv243\build\x86\vc10\bin\opencv_ffmpeg243.dll', Binary was not built with debug information.

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\wsock32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll', Cannot find or open the PDB file

'Video frames try.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file The program '[6268] Video frames try.exe: Native' has exited with code 1 (0x1).