Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Opencv read video stream from Zoneminder

Hello all,

I'm trying to read and display a video stream from Zoneminder on Ubuntu.

I am using eclipse with opencv. The code is here:

#include <cv.h>
#include <highgui.h>
using namespace cv;
int main(int argc, char *argv[])

   { Mat frame;
     namedWindow("video", 1);

//the next line is to capture the video stream of the URL from Zoneminder

      VideoCapture cap("");
     while ( cap.isOpened() )
         cap >> frame;
         if(frame.empty()) break;

         imshow("video", frame);
         if(waitKey(30) >= 0) break;

    return 0;

Note that I copied the URL( from the image information on the monitor of zoneminder.

This code works for my webcam, as well as other ip cameras. I also tested the URL in VLC, and it works fine.

Does anyone know what should I do to read the video stream from Zoneminder?

Thank you very much!