Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Video streaming with opencv 2.4.7 on visual studio 2010

Hi all :) I tried to load tree.avi file present in sample code of opencv 2.4.7 on visual studio 2010 express edition. I used following code :

include<opencv\highgui.h>

include<stdio.h>

include<opencv\cv.h>

include<conio.h>

include <opencv2 imgproc="" imgproc.hpp="">

include <opencv2 core="" core.hpp="">

include <opencv2 highgui="" highgui.hpp="">

include<iostream>

using namespace cv; using namespace std;

int main() { CvCapture* capture = cvCreateFileCapture("C:\opencv247\samples\c\tree.avi");

IplImage* frame = NULL;

if(!capture)
{
    printf("Video Not Opened\n");
    return -1;
}

int width = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH);
int height = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT);
double fps = cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
int frame_count = (int)cvGetCaptureProperty(capture,  CV_CAP_PROP_FRAME_COUNT);

printf("Video Size = %d x %d\n",width,height);
printf("FPS = %f\nTotal Frames = %d\n",fps,frame_count);

while(1)
{
    frame = cvQueryFrame(capture);

    if(!frame)
    {
        printf("Capture Finished\n");
        break;
    }

    cvShowImage("video",frame);
    cvWaitKey(10);
}

cvReleaseCapture(&capture);
return 0;

}

I am getting following result after I debug the above code and thus video is not opening :

'OPEN_CV_TEST.exe': Loaded 'C:\Users\Shivam\Documents\Visual Studio 2010\Projects\OPEN_CV_TEST\Debug\OPEN_CV_TEST.exe', Symbols loaded.

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\ntdll.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\kernel32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\opencv247\build\x86\vc10\bin\opencv_highgui247d.dll', Cannot find or open the PDB file

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\user32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\gdi32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\lpk.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\usp10.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\ole32.dll', Symbols loaded.

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\advapi32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\sechost.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\opencv247\build\x86\vc10\bin\opencv_core247d.dll', Cannot find or open the PDB file

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\avifil32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\winmm.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msacm32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msvfw32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\shell32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\avicap32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\version.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\imm32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msctf.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\opencv247\build\x86\vc10\bin\opencv_ffmpeg247.dll', Binary was not built with debug information.

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\ws2_32.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\nsi.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\cryptbase.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\uxtheme.dll', Symbols loaded (source information stripped).

'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\clbcatq.dll', Symbols loaded (source information stripped). The program '[4588] OPEN_CV_TEST.exe: Native' has exited with code -1 (0xffffffff).

I don't know where I am doing mistake. Please help me. Thanks.

Video streaming with opencv 2.4.7 on visual studio 2010

Hi all :) I tried to load tree.avi file present in sample code of opencv 2.4.7 on visual studio 2010 express edition. I used following code :

include<opencv\highgui.h>

include<stdio.h>

include<opencv\cv.h>

include<conio.h>

include <opencv2 imgproc="" imgproc.hpp="">

include <opencv2 core="" core.hpp="">

include <opencv2 highgui="" highgui.hpp="">

include<iostream>

#include<opencv\highgui.h>
#include<stdio.h>
#include<opencv\cv.h>

#include<conio.h>
#include <opencv2/imgproc/imgproc.hpp>   
#include <opencv2/core/core.hpp>         
#include <opencv2/highgui/highgui.hpp>

#include<iostream>


using namespace cv;
using namespace std;

std; int main() { CvCapture* capture = cvCreateFileCapture("C:\opencv247\samples\c\tree.avi");

cvCreateFileCapture("C:\opencv247\samples\c\tree.avi");

    IplImage* frame = NULL;

 if(!capture)
 {
     printf("Video Not Opened\n");
     return -1;
 }

 int width = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH);
 int height = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT);
 double fps = cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
 int frame_count = (int)cvGetCaptureProperty(capture,  CV_CAP_PROP_FRAME_COUNT);

 printf("Video Size = %d x %d\n",width,height);
 printf("FPS = %f\nTotal Frames = %d\n",fps,frame_count);

 while(1)
 {
     frame = cvQueryFrame(capture);

     if(!frame)
     {
         printf("Capture Finished\n");
         break;
     }

     cvShowImage("video",frame);
     cvWaitKey(10);
 }

 cvReleaseCapture(&capture);
 return 0;
}

}

I am getting following result after I debug the above code and thus video is not opening :

'OPEN_CV_TEST.exe': Loaded 'C:\Users\Shivam\Documents\Visual Studio 2010\Projects\OPEN_CV_TEST\Debug\OPEN_CV_TEST.exe', Symbols loaded.

loaded. 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\ntdll.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\kernel32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\opencv247\build\x86\vc10\bin\opencv_highgui247d.dll', Cannot find or open the PDB file

file 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\user32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\gdi32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\lpk.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\usp10.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\ole32.dll', Symbols loaded.

loaded. 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\advapi32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\sechost.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\opencv247\build\x86\vc10\bin\opencv_core247d.dll', Cannot find or open the PDB file

file 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.

loaded. 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.

loaded. 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\avifil32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\winmm.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msacm32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msvfw32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\shell32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\avicap32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\version.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\imm32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\msctf.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\opencv247\build\x86\vc10\bin\opencv_ffmpeg247.dll', Binary was not built with debug information.

information. 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\ws2_32.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\nsi.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\cryptbase.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\uxtheme.dll', Symbols loaded (source information stripped).

stripped). 'OPEN_CV_TEST.exe': Loaded 'C:\Windows\System32\clbcatq.dll', Symbols loaded (source information stripped). The program '[4588] OPEN_CV_TEST.exe: Native' has exited with code -1 (0xffffffff).

(0xffffffff).

I don't know where I am doing mistake. Please help me. Thanks.