I'm trying to access the video stream from an Axis M1013 camera using OpenCV. I'm trying to get the video by using VideoCapture
, but all of the urls that I try to open don't return anything. I can access the Live View of the camera through my browser, but if I put in the urls that are supposed to return a video stream, I either get nothing or "No session ID specified." How do I access the MJPG video feed?
I've tried the following urls:
http://<user>:<password>@<ip>:554/mjpg/1/video.mjpg
http://<user>:<password>@<ip>:554/mjpg/video.mjpg
http://<user>:<password>@<ip>/mjpg/1/video.mjpg
http://<user>:<password>@<ip>/mjpg/video.mjpg
http://<user>:<password>@<ip>:554/axis-cgi/mjpg/video.cgi
http://<user>:<password>@<ip>/axis-cgi/mjpg/video.cgi
But none of them work.
My code is:
VideoCapture vCap;
vCap.open("http://<user>:<password>@<ip>:554/mjpg/1/video.mjpg");
And the error I get is:
WARNING: Couldn't read movie file http://<user>:<password>@<ip>:554/mjpg/1/video.mjpg
(Of course, I'm using the actual username, password, and camera ip)
I'm using OpenCV version 2.4.9 with C++ and an Axis M1013 camera.
It turned out that the problem was just that I did not have ffmpeg properly installed so OpenCV could not decode the mjpg video stream. Once I reinstalled ffmpeg and OpenCV using this tutorial , it worked fine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.