Ask Your Question
0

How do I control the PTZ function of IP camera using C++ [closed]

asked 2017-10-04 01:20:16 -0500

Sanjay gravatar image

I am working on a project that requires the control of the PTZ function of my IP camera through the UI. I am currently using a D-Link DCS-5020L cloud camera, Microsoft Visual Studio 2017 and OpenCV 3.3 for my setup.

I am still new to C++ OpenCV but my project requires the use of it. I am able to access the camera feed but I'm not sure how to control the functions of the camera using C++ code through OpenCV or if OpenCV is even needed.

Is there a C++ code to control the PTZ functions of the IP camera?

This is my code for attaining the video output, if necessary.

// VIDEO CAPTURE //

Mat frame;

VideoCapture cap("http://username:password@IPADDRESS:PORT/video.cgi?resolution=640x360&req_fps=30&.mjpg");

if (!cap.isOpened())    //EXIT PROGRAM IF FAILED
{
    cout << "CAMERA UNAVAILABLE" << endl;
    return -1;
}
while (1)
{
    bool bSuccess = cap.read(frame);    //READ NEW FRAME FROM VIDEO

    if (!bSuccess)      //BREAK LOOP IF FAILED
    {
        cout << "UNABLE TO DISPLAY VIDEO" << endl;
        break;
    }
}

Any help is appreciated. Thank you.

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by berak
close date 2017-10-04 01:34:33.158443

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-10-04 01:30:46 -0500

berak gravatar image

opencv does not have any means to do this.

your cam is probably running some web server, and you'll have to access that, to move your camera.

please study your camera's manual, we cannot help much from here.

edit flag offensive delete link more

Comments

Thanks for the reply and clarification.

Sanjay gravatar imageSanjay ( 2017-10-07 23:18:41 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-10-04 01:20:16 -0500

Seen: 400 times

Last updated: Oct 04 '17