Error when Capturing RTSP IP Camera [closed]
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;
}
You should use C++ API. If the problem persists, then the problem is because the image failed to load/arrive; but first start changing it to C++ (include .hpp, use cv::functionName, cv::Mat instad of IplImage pointer, etc).
I had tried the solution that you gave but the result was the same. What must I do to solve that problem ? Please help me
please update the code in the post to see better ;)