Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
int main()
{
    VideoCapture cap("http://213.157.112.12:8082/mjpg/video.mjpg?resolution=352x288");
    Mat frame; 
    namedWindow("video", 1);
    while(cap.isOpened()) {
        cap >> frame;
        if(!frame.data) break;
            //
            // now you can process process the frame data
            //
        imshow("video", frame);
        if(waitKey(30) >= 0) break;
    }   
    return 0;
}
#include "opencv/cv.h"
#include "opencv/highgui.h"
using namespace cv;

int main()
{
    VideoCapture cap("http://213.157.112.12:8082/mjpg/video.mjpg?resolution=352x288");
    Mat frame; 
    namedWindow("video", 1);
    while(cap.isOpened()) {
        cap >> frame;
        if(!frame.data) break;
            //
            // now you can process process the frame data
            //
        imshow("video", frame);
        if(waitKey(30) >= 0) break;
    }   
    return 0;
}