OPENCV to get MJGP-Streamer video stream processing method param.m

2023-03-17  

By transplanting MJPG-Streamer to ARM, you can send the video stream of the USB camera to the computer browser through the HTTP protocol.

But how to get video streams for opencv for video image processing? In fact, it is very simple. You only need to pass the video flow URL address to the CVCAPTUREFROMFILE function.

Here you need to pay attention to a question is to add behind the URL?dummy=param.MJPG, otherwise OpenCV will prompt to find the decoder.

The code is given below:

#include “stdafx.h”
#include “cv.h”
#include “highgui.h”

int main()
{

    CvCapture* capture = cvCaptureFromFile(“http://192.168.1.101:8080/?action=stream?dummy=param.mjpg“);
    IplImage* frame;
    cvNamedWindow(“frame”);
    while(frame = cvQueryFrame(capture))
    {

    cvShowImage(“frame”,frame);
    cvWaitKey(33);
    }
    cvReleaseCapture(&capture);
    cvDestroyAllWindows();
    return 0;
}

source

Random Posts

FLEX layout browser compatibility problem

docker ushered in Windows Subsystem for Linux 2docker

java array split

Record SpringBoot2.x uses the problem of avTiveMQ, the log repeatedly prints the transaction commit: null, and the connection pool jmmessagingtemplate cannot inject the problem Firesky Firesky Firesky Firesky

Codeforcess -987Cthree Displays -Backpack + DPSCAR