title: Controlling the PTZ function of IP camera using C++
body: <p>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 <strong>D-Link DCS-5020L</strong> cloud camera, <strong>Microsoft Visual Studio 2017</strong> and <strong>OpenCV 3.3</strong> for my setup. </p>
  
  <p>I am still new to c++ and 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. </p>
  
  <p>Is there a C++ code to control the PTZ functions of the IP camera?</p>
  
  <p>This is my code for attaining the video output, if necessary.</p>
  
  <pre><code>// VIDEO CAPTURE //
  
  Mat frame;
  
  VideoCapture cap("http://username:password@IPADDRESS:PORT/video.cgi?resolution=640x360&amp;req_fps=30&amp;.mjpg");
  
  if (!cap.isOpened())    //EXIT PROGRAM IF FAILED
  {
      cout &lt;&lt; "CAMERA UNAVAILABLE" &lt;&lt; endl;
      return -1;
  }
  while (1)
  {
      bool bSuccess = cap.read(frame);    //READ NEW FRAME FROM VIDEO
  
      if (!bSuccess)      //BREAK LOOP IF FAILED
      {
          cout &lt;&lt; "UNABLE TO DISPLAY VIDEO" &lt;&lt; endl;
          break;
      }
  }
  </code></pre>
  
  <p>Any help is appreciated. Thank you.</p>