简体   繁体   中英

OpenCV : Open Mobotix Camera Feed

I have a Mobotix Camera. It is an IP Camera. In the API they offer us the possibility to get the feed via

http:// [ user ]:[ password ]@[ ip_adress ]:[ port ]/cgi-bin/faststream.jpg?[ options ]


What I've tried is to open it like a normal webcam feed :

cv::VideoCapture capture("http://...");
cv::Mat frame;

if (capture.isOpened())
    // always false anyway.
while(1)
{
    capture.read(frame);
    cv::imshow("Hi there", frame);
    cv::waitkey(10);
}

FYI : Developer Mobotix API Docs


EDIT : Now thanks to berak I just had to add &data=v.mjpg to the options :

?stream=full&fps=5.0&noaudio&data=v.mjpg

Note that in v.mjpg, only the [dot]mjpg is important, you could as well put myfile.mjpg.

Now the problem is the speed at which the feed update. I got a 2 seconds delay, plus the feed is very very slow. And when I change the stream option for MxJPG or mxg I get a corrupted image where the bytes aren't ordering properlly.

EDIT : I tried to change the camera parameters directly with the mobotix control center but only the resolution affected my OpenCV program, without actually changing the speed at which I access the images.

for max speed use fps=0 Its in the api docs

something like

http://cameraip/cgi-bin/faststream.jpg?stream=full&fps=0

see http://developer.mobotix.com/paks/help_cgi-image.html

faststream is the mjpeg stream (for image capture) , make sure mxpeg is turned off and pick the smallest image that gives you enough resolution. ie get it working using 640 by 480 (set it camera webgui) then increase the image size.

Note this is for image capture not video and you need to detect the beginning and end of each jpeg then copy from receive buffer into memory.

vlc can handle mxpeg ,but need to either start from command line with vlc --ffmpeg-format=mxg or set an edit option ffmpeg-format=mxg in the gui see https://wiki.videolan.org/MxPEG

I know this post is quite old but I thought to answer for anyone else who comes across this issue. To get a stream without frame rate limitations you need to use a different CGI command:

http://<camera_IP>/control/faststream.jpg?stream=full&fps=0

As per the camera's on-line help:

http://<camera_IP>/cgi-bin/faststream.jpg (guest access)
http://<camera_IP>/control/faststream.jpg (user access)

The default limitation of the "guest" access is indeed 2 fps but it can be modified from the page Admin Menu > Language and Start Page.

A detailed description of how to retrieve a live stream from a MOBOTIX camera is available at the following link: https://community.mobotix.com/t/how-to-access-a-live-stream-with-a-video-client-eg-vlc/202

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM