I'm using opencv 1.1pre1 under windows. I have a Network Camera and I need to grab frames from opencv. that camera can stream a standard MPEG4 stream over RTSP or MJPEG over HTTP. I 've seen into threads talking about using FFMPEG with opencv but I cannot make it work.
How I can grab frames from an IP camera with opencv?
Thanks
Andrea
============
Use ffmpeglib to connect to the stream.
These functions may be useful. But take a look in the docs
av_open_input_stream(...);
av_find_stream_info(...);
avcodec_find_decoder(...);
avcodec_open(...);
avcodec_alloc_frame(...);
You wowould need a little algo to get a complete frame, which is available here
http://www.dranger.com/ffmpeg/tutorial01.html
Once you get a frame you cocould copy the video data (for each plane if needed) into a iplimage which is an opencv image object.
You can create an iplimage using something like...
IplImage *p_gray_image = cvCreateImage(size, IPL_DEPTH_8U, 1);
Once you have an iplimage, you cocould perform all sorts of image operations available in the opencv lib
Link | flag |
Answered APR 3'09 at 9: 31 indeera 1, 68339 |
|
I 've seen in our threads that FFmpeg is already embedded and used inside opencv, is this right? Maybe I need to recompile opencv with ffgmpeg support? In this case how I can do this under windows? Thanks-grifo APR 3'09 |
|
I'm not aware of this. however, FFmpeg is an application where as ffmpeglib is a library. if you are new to these please look at the dranger.com tutorials. -indeera Apr 3 '09 |
========================
Opencv can be compiled with FFMPEG support. From./Configure -- Help:
--with-ffmpeg use ffmpeg libraries (see LICENSE) [automatic]
You can then use * cvcreatefilecapture_ffmpeg * to create a cvcapture with e.g. the URL of the camera's mjpg stream.
I use this to grab frames from an axis camera:
CvCapture *capture =
cvCreateFileCapture_FFMPEG("http://axis-cam/mjpg/video.mjpg?resolution=640x480&req_fps=10&.mjpg");
Link | flag |
Answered Jun 18 '09 at 14: 28f3lix 4,8093622 |
|
Is it possible to configure opencv with FFMPEG support under windows? -Grifo Jun 25 '09 |
==============
I just do it like this:
CvCapture *capture = cvCreateFileCapture("rtsp://camera-address");
Also make sure this DLL is available at runtime else cvcreatefilecapture will return null
opencv_ffmpeg200d.dll
The camera needs to allow unauthenticated access too, usually set via its web interface. MJPEG format worked via RTSP but MPEG4 didn't.
Hth
Si
Link | flag |
Answered Feb 11 at 11: 48 sipickles 1075 |
|
Are you using opencv 2.0? -Grifo Mar 2 at 8:41 |
|
The Library version says that he is using opencv 2.0-that's200 Part inopencv_ffmpeg200d.dll -Jamuraa Mar 17 at 20:41 |
==============================