Ask Your Question
1

Error while trying to display video stream from IP camera via Internet [closed]

asked 2014-01-20 04:33:58 -0600

xMayank gravatar image

updated 2014-01-20 04:36:32 -0600

I have small code which is able to display the IP camera using its local IP address. But when the camera is used by its Public IP address i am unable to get the live feed.

include "IpCamTest.h"

int main(int, char**) { cv::VideoCapture vcap; cv::Mat image;

// This works on a D-Link CDS-932L
//const std::string videoStreamAddress = "http://aID:[email protected]:80/video.cgi?resolution=640x360&req_fps=50&.mjpg";
const std::string videoStreamAddress = "http://id:[email protected]:8088/video.cgi?resolution=640x360&req_fps=50&.mjpg";
//open the video stream and make sure it's opened
if(!vcap.open(videoStreamAddress)) {
    std::cout << "Error opening video stream or file" << std::endl;
    return -1;
}

for(;;) {
    if(!vcap.read(image)) {
        std::cout << "No frame" << std::endl;
        cv::waitKey();
    }
    cv::imshow("Output Window", image);

    if(cv::waitKey(1) >= 0) break;
}

} warning: Could not find codec parameters (../../modules/highgui/src/cap_ffmpeg_impl.hpp:540) Error opening video stream or file

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by StevenPuttemans
close date 2014-01-20 04:55:02.754564

Comments

Actually can you stick to a single question and update it with your information? I will close this one and keep the other one open.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-01-20 04:54:47 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-01-20 04:39:40 -0600

Will Stewart gravatar image

If you have a static IP address from your ISP, the answer is "Yes", though you have to 'port forward' the request via your router if you are wanting to directly connect to the camera. It is still possible if you have a non-static IP address, though a workaround is necessary in order to communicate IP address updates.

https://www.whatismyip.com/port-forwarding/

You also have to ensure your firewall is set to accept requests from whomever is allowed to access the camera feed.

edit flag offensive delete link more

Comments

I did not what exactly you are trying to say. I have very limited knowledge of Networking. Please make me understand in simpler terms. Is their any setting needed to be done for accessing the IP camera then please tell me.

xMayank gravatar imagexMayank ( 2014-01-20 04:46:10 -0600 )edit

Question Tools

Stats

Asked: 2014-01-20 04:33:58 -0600

Seen: 1,254 times

Last updated: Jan 20 '14