title: OpenCV: How to capture frames from an Ethernet camera
body: <p>I have earlier programmed USB webcam, where the sole aim is to get the live frames from the camera and display in a window.  I used cvCaptureFromCAM for that purpose, which worked fine for USB Camera(see code below).</p>
  
  <p>I want to know how do I capture frames from a Gigabit Ethernet camera?  I guess I need to capture frames from some default IP address using some API. Can some one point me to right direction? </p>
  
  <p>I will be using C++ with OpenCV on Windows 7 on an Intel i3 processor. </p>
  
  <pre><code>#include "cv.h"
  #include "highgui.h"
  #include &lt;stdio.h&gt;
  
  // A Simple Camera Capture Framework 
  int main() {
      CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );
      if ( !capture ) {
          fprintf( stderr, "ERROR: capture is NULL \n" );
          getchar();
          return -1;
      }
  
      // Create a window in which the captured images will be presented
      cvNamedWindow( "mywindow", CV_WINDOW_AUTOSIZE );
  
      // Show the image captured from the camera in the window and repeat
      while ( 1 ) {
          // Get one frame
          IplImage* frame = cvQueryFrame( capture );
  
          if ( !frame ) {
              fprintf( stderr, "ERROR: frame is null...\n" );
              getchar();
              break;
          }
  
          cvShowImage( "mywindow", frame );
  
          // Do not release the frame!
          // If ESC key pressed, Key=0x10001B under OpenCV 0.9.7(linux version),
          // remove higher bits using AND operator
          if ( (cvWaitKey(10) &amp; 255) == 27 ) break;
      }
  
      // Release the capture device housekeeping
      cvReleaseCapture( &amp;capture );
      cvDestroyWindow( "mywindow" );
      return 0;
  }
  </code></pre>
  
  <p><strong>Update</strong> </p>
  
  <p>So now I am able to display the live images in the vendor provided software GUI. But still I want to display the image (and possibly video) using the IP address of the camera. </p>
  
  <p>When I know the IP address of the camera, why can't I access the data (images) sent by the camera and display on browser? I tried typing the ip address of the camera (i.e 192.169.2.3) on my browser (192.169.2.4), but it say "page not found". What does it mean?   </p>