Error when capture RTSP IP Camera using OpenCV 2.10 and Visual Studio 2008
Hi ! I am newbie in openCV. I made a program to access IP Camera that support RTSP protocol using OpenCV 2.10 and Visual Studio 2008. I made this program using Win32 Application. When I debug my program, my frame could open once and I got some error.
The error said:
"Compiler
Compiler
did not align
stack stack
variables. Libavcodec has
been been
miscompiled and may be very slow
or or
crash. This is not a bug
in in
libavcodec, but in the compiler.
You You
may try recompiling using gcc >=
4.2. 4.2.
Do not report crashes to
FFmpeg developers. FFmpeg
developers. An unhandled exception of type 'System.AccessViolationException' type
'System.AccessViolationException'
occurred in CobaKameraIPConsole.exe
Additional information: Attempted to to
read or write protected memory. This This
is often an indication that other other
memory is corrupt."
corrupt. This is my code :
include "stdafx.h"
include "cv.h"
include "cxcore.h"
include "highgui.h"
IplImage *in_img;
using namespace System;
int main(array<system::string ^>="" ^args)="" {<="" p="">
#include "stdafx.h"
#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
IplImage *in_img;
using namespace System;
int main(array<System::String ^> ^args)
{
CvCapture *URLKamera1 = cvCaptureFromFile("rtsp://192.168.1.125:554//user=admin_password=tlJwpbo6_channel=1_stream=0.sdp?real_stream");
while(1)
{
in_img = cvQueryFrame (URLKamera1);
cvShowImage("input image",in_img);
int key = cvWaitKey(1);
if ((key==27)|(key==13)) break; //key 27 escape, key 13 enter
}
cvReleaseCapture(&URLKamera1);
cvDestroyWindow("input image");
return 0;
0;
}
}