[FFmpeg-devel] FFMPEG video4linux2: is read() still supported?
frank at frankvh.com
frank
Fri Mar 7 23:55:33 CET 2008
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.
Here's an example:
root:/> ffmpeg -debug pict -r 3 -f video4linux2 -pix_fmt rgb24 -an -s
640x480 -i /dev/video0 -f mpegts -r 25 udp:192.168.1.81:1234
FFmpeg version SVN-r6339, Copyright (c) 2000-2007 Fabrice Bellard, et
al.
configuration: --prefix=/usr
--source-path=/home/frank/blackfin-sources/branch-2008R1/dulinux-dist/lib/ffmpeg/build/../ffmpeg-svn-11114
--target-os=Linux --cpu=bfin --arch=bfin --extra-ldflags=
-mcpu=bf537-0.2 --enable-static --enable-shared --enable-gpl --enable-pp
--disable-strip --cross-prefix=bfin-linux-uclibc-
libavutil version: 49.5.0
libavcodec version: 51.48.0
libavformat version: 52.1.0
built on Mar 7 2008 13:37:30, gcc: 4.1.2 (ADI svn)
dummy_camera: entering camera_open() - return ok
dummy_camera: IOCTL VIDIOC_QUERYCAP - return ok
[video4linux2dummy_camera: IOCTL VIDIOC_S_FMT @
0x5208c0][3]Capabilities: 1000001
- return ok
dummy_camera: IOCTL VIDIOC_ENUMINPUT - return ok
[video4linux2dummy_camera: IOCTL VIDIOC_S_INPUT @ 0x5208c0]The V4L2
driver set input_id: 0, input: Dummy Camera
- return ok
dummy_camera: entering camera_close()
/dev/video0: I/O error occured
Usually that means that input file is truncated and/or corrupted.
root:/>
We can see that FFMPEG is querying the device, and the capabilities
shows that read/write is supported but streaming is not. Then FFMEG
enumerates the device inputs, then sets an input (input 0 in this case).
All very nice. But then FFMPEG suddenly calls close() and exits.
I'm wondering if the FFMPEG V4L2 code requires the use of mmap, and
simply shuts down if its not available. That's what it's looking like to
me anyway. Does anyone have any thoughts?
Thanks.
More information about the ffmpeg-devel
mailing list