cap.open URL video or image is not working if ...mjpg?resolution

asked 2015-01-05 10:44:44 -0600

Held22 gravatar image

That is working

cv::VideoCapture cap("http://myIP:1102/mjpg/video.mjpg");
    cv::Mat img;
    cap.open("http://myIP:1102/mjpg/video.mjpg");
        if (cap.isOpened()) 
        {               
            cap.read(img);
        }

But not that, why?

cv::VideoCapture cap("http://myIP:1102/mjpg/video.mjpg?resolution=1280x960&compression=0&rotation=270");
    cv::Mat img;
    cap.open("http://myIP:1102/mjpg/video.mjpg?resolution=1280x960&compression=0&rotation=270");
        if (cap.isOpened()) 
        {               
            cap.read(img);
        }

Same with "/axis-cgi/jpg/image.cgi"...

edit retag flag offensive close merge delete

Comments

Be happy that streaming works already without the parameters. OpenCV was not optimized for this and it hasn't worked for a long time. As to streaming, I would look into other libraries than OpenCV to grab the images then process them with OpenCV!

StevenPuttemans gravatar imageStevenPuttemans ( 2015-01-06 07:03:45 -0600 )edit