[FFmpeg-devel] FFMPEG video4linux2: is read() still supported?

Luca Abeni lucabe72
Mon Mar 10 09:03:40 CET 2008


Hi Frank,

frank at frankvh.com wrote:
> I'm writing a simple V4L2 driver, very loosely based on an existing V4L1
> driver:
> 
> http://www.kevinboone.com/README_dummy-camera.html
> 
> The V4L1 driver is very simple; it does *not* support mmap; it only
> supports read() for obtaining video data. FFMPEG works fine with the
> V4L1 driver. 
> 
> Moving this same functionality to a V4L2 driver, FFMPEG no longer works.
[...]

The "read()" access to video frames is currently not implemented in
libavformat/v4l2.c. I never found a v4l2 driver that does not support
mmap(), so I've been lazy and I did not implement the methods using
read().
See libavformat/v4l2.c::read_frame().

Everything you need to do is to implement read_frame() (which currently
returns -1), and everything should work.


> I'm wondering if the FFMPEG V4L2 code requires the use of mmap, and
> simply shuts down if its not available.

As you can see, this is the current behaviour. Patches are welcome ;-)



				Luca




More information about the ffmpeg-devel mailing list