title: Reading images from AXIS ip camera using OpenCV
body: <p>I am trying to access AXIS IP camera from my program using OpenCV.
  My OpenCV version is 3.1. I follow this tutorial <a href="http://funvision.blogspot.sg/2015/11/opencv-300-videocapture-file-web-camera.html" rel="nofollow">link</a>.</p>
  
  <p>I have all libraries installed.
  My following program can load mp4 video successfully. That means ffmpeg and necessary libraries are working fine.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;opencv2/opencv.hpp&gt;
  
  using namespace std;
  int main() {
      cv::VideoCapture vcap("test.mp4");
      cv::Mat image;
  //    const string address = "rtsp://root:pass@192.168.0.90/axis-media/media.amp?camera=1";
  //    if(!vcap.open(address)){
  //      std::cout &lt;&lt; "Error opening video stream or file " &lt;&lt; std::endl;
  //      return -1;
  //    }
      for(;;){
          if(!vcap.read(image)){
              std::cout &lt;&lt; "No frame" &lt;&lt; std::endl;
              cv::waitKey(0);
          }
          cv::imshow("Display", image);
          cv::waitKey(1);
      }
      return 0;
  }
  </code></pre>
  
  <p>When I tried to access the IP Camera as follow</p>
  
  <pre><code>cv::VideoCapture vcap("rtsp://root:pass@192.168.0.90/axis-media/media.amp?camera=1");
  </code></pre>
  
  <p>I have the following error</p>
  
  <pre><code>GStreamer Plugin: Embedded video playback halted; module source reported: Could 
  not open resource for reading and writing.
  OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
  ) in cvCaptureFromCAM_GStreamer, file /home/Softwares/opencv/opencv/modules
  /videoio/src/cap_gstreamer.cpp, line 818
  terminate called after throwing an instance of 'cv::Exception'
    what():  /home/Softwares/opencv/opencv/modules/videoio/src/cap_gstreamer.
  cpp:818: error: (-2) GStreamer: unable to start pipeline
   in function cvCaptureFromCAM_GStreamer
  </code></pre>
  
  <p>User is root and password is pass and ip 192.168.0.90 are all defaults.</p>
  
  <p>My if config gave me</p>
  
  <pre><code>ifconfig
  eth0      Link encap:Ethernet  HWaddr b8:2a:72:c6:b8:13  
            inet6 addr: fe80::ba2a:72ff:fec6:b813/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:723959 errors:0 dropped:0 overruns:0 frame:0
            TX packets:116637 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000 
            RX bytes:199422245 (199.4 MB)  TX bytes:13701699 (13.7 MB)
  
  lo        Link encap:Local Loopback  
            inet addr:127.0.0.1  Mask:255.0.0.0
            inet6 addr: ::1/128 Scope:Host
            UP LOOPBACK RUNNING  MTU:65536  Metric:1
            RX packets:24829 errors:0 dropped:0 overruns:0 frame:0
            TX packets:24829 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0 
            RX bytes:2502903 (2.5 MB)  TX bytes:2502903 (2.5 MB)
  
  wlan0     Link encap:Ethernet  HWaddr a0:a8:cd:99:92:60  
            UP BROADCAST MULTICAST  MTU:1500  Metric:1
            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000 
            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
  </code></pre>
  
  <p>What could be the problem for this access to the camera?</p>
  
  <p>Thanks</p>