Error when capture RTSP IP Camera using OpenCV 2.10 and Visual Studio 2008 [closed]
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 did not align stack variables. Libavcodec has been miscompiled and may be very slow or crash. This is not a bug in libavcodec, but in the compiler. You may try recompiling using gcc >= 4.2. Do not report crashes to FFmpeg developers.
An unhandled exception of type 'System.AccessViolationException' occurred in CobaKameraIPConsole.exe
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is 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)
{
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;
}
OpenCV 2.10 ? that's no more valid !
please, update to a more recent opencv version, and try again..
I have ever tried to use opencv 2.4.10 using VS 2008 but I always got some error, Missing MSVCP120.dll . How can I solve that problem ?
O man o man o man ... first of all, using OpenCV 2.anything with a C-API is not valid anymore. You should follow the official OpenCV installation guide for VS to have a hang on installing the latest version, which works just fine on VS2008. Take a look at the following links
MSVCP120.dll is the Microsoft Visual C++ Redistribuables for Visual Studio 2013. There should be some link errors ?
Ok thank you all. I have upgraded my openCV to 2.4.11 and my Visual Studio to VS 2012 and it works :) God bless you all :)