Hi all ! I am working to connect my IP Camera using openCV 2.4.11 and VS 2012. My IP Camera supports H.264 video compression. When I program it using openCV, it can be connected and I can capture image from it but when I try to mount my camera in parking area of my campus and I run my program again, I got some error. This error is like this. How to solve this problem ? Thank you.
This is my code :
pragma once
include "stdafx.h"
include <opencv\cv.h>
include <opencv\highgui.h>
include <iostream>
using namespace SistemKameraWrapper; using namespace cv;
IplImage *InputImage1;
void CameraWrapper::AksesKamera() { CvCapture *Kamera1 = cvCaptureFromFile("rtsp://192.168.1.127:554//user=admin_password=tlJwpbo6_channel=1_stream=0.sdp?real_stream"); cvNamedWindow("input image 1", CV_WINDOW_FREERATIO); cvResizeWindow("input image 1", 400, 300);
while(1)
{
InputImage1 = cvQueryFrame (Kamera1);
cvShowImage("input image 1",InputImage1);
int key = cvWaitKey(1);
if ((key==27)|(key==13)) break; //key 27 escape, key 13 enter
}
cvReleaseCapture(&Kamera1);
cvDestroyWindow("input image 1");
return;
}