Error when Capturing RTSP IP Camera [closed]

asked 2015-08-04 22:18:06 -0500

dhaniarianda gravatar image

updated 2015-08-05 02:31:13 -0500

thdrksdfthmn gravatar image

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.image description

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://");
    cvNamedWindow("input image 1", CV_WINDOW_FREERATIO);
    cvResizeWindow("input image 1", 400, 300);

        InputImage1 = cvQueryFrame (Kamera1);
        cvShowImage("input image 1",InputImage1);
        int key = cvWaitKey(1);
        if ((key==27)|(key==13)) break; //key 27 escape, key 13 enter
    cvDestroyWindow("input image 1");
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-12-18 15:17:38.600439


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).

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-08-05 02:33:37 -0500 )edit

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

dhaniarianda gravatar imagedhaniarianda ( 2015-08-07 00:23:00 -0500 )edit

please update the code in the post to see better ;)

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-08-07 02:25:41 -0500 )edit