Ask Your Question
0

Problem in opening the video files using Open CV

asked 2013-06-25 20:52:26 -0600

Vijay Kakani gravatar image

updated 2013-06-25 22:28:36 -0600

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 ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-06-25 22:33:24 -0600

Probably, the path isn't good (F:\Bee videos\P1040356.mov), try to escape the backslash: F:\Bee videos\P1040356.mov

To be sure, add a log message in your code:

if (!capture.isOpened())
{
    std::cerr << "Unable to load the video" << std::endl;
    return 1;
}

use a terminal (cmd.exe) and launch your program to see the log message (or not).

edit flag offensive delete link more

Comments

Thanks a million Mathieu, It is working perfectly now. I added a log message above and changed the backslash... I'm new to Open CV, some of my questions seems little silly but thanks for answering with patience.

Kindest Regards, Vijay Kakani

Vijay Kakani gravatar imageVijay Kakani ( 2013-06-26 08:13:58 -0600 )edit

And how you resloved this problem?? Now i have same error with same output listing in VS2010.... it's my question http://answers.opencv.org/question/24843/dont-work-cvvideocapture/ Thanks!

Dark2013 gravatar imageDark2013 ( 2013-12-02 08:27:06 -0600 )edit

Question Tools

Stats

Asked: 2013-06-25 20:52:26 -0600

Seen: 4,046 times

Last updated: Jun 25 '13