запускаю захват с /dev/video0[immortal@vsep55 video]$ ffmpeg -t 10 -f video4linux2 -s 640x480 -r 15 -b 700k -i /dev/video0 -f avi /home/immortal/video/cam2_`date +%Y-%m-%d_%H:%M:%S`.avi
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-shared --libdir=/usr/lib --shlibdir=/usr/lib --incdir=/usr/include --enable-postproc --enable-gpl --enable-pthreads --enable-libtheora --enable-libvorbis --enable-x11grab --enable-swscale
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Sep 2 2009 04:51:23, gcc: 4.4.1
[video4linux2 @ 0x92b3aa0][3]Capabilities: 4000001
Input #0, video4linux2, from '/dev/video0':
Duration: N/A, start: 1264741440.524889, bitrate: 460799 kb/s
Stream #0.0: Video: rawvideo, yuyv422, 1600x1200, 460799 kb/s, 15 tbr, 1000k tbn, 15 tbc
Output #0, avi, to '/home/immortal/video/cam1_2010-01-29_08:03:59.avi':
Stream #0.0: Video: mpeg4, yuv420p, 1600x1200, q=2-31, 700 kb/s, 90k tbn, 15 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 159 fps= 5 q=3.7 Lsize= 2344kB time=31.67 bitrate= 606.3kbits/s
захват идет, запускаю захват с /dev/video1
[root@vsep55 video]# fmpeg -t 10 -f video4linux2 -s 640x480 -r 15 -b 700k -i /dev/video1 -f avi /home/immortal/video/cam2_`date +%Y-%m-%d_%H:%M:%S`.avi
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-shared --libdir=/usr/lib --shlibdir=/usr/lib --incdir=/usr/include --enable-postproc --enable-gpl --enable-pthreads --enable-libtheora --enable-libvorbis --enable-x11grab --enable-swscale
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Sep 2 2009 04:51:23, gcc: 4.4.1
[video4linux2 @ 0x9aa2ac0][3]Capabilities: 4000001
[video4linux2 @ 0x9aa2ac0]ioctl(VIDIOC_STREAMON): No space left on device
/dev/video1: I/O error occurred
Usually that means that input file is truncated and/or corrupted.
ошипка.
Нарыл статью 1999 года
Device Minor Numbers
Because V4L2 is a catch-all for a wide variety of devices on different kinds of busses, there is no good way for it to automatically assign device minor numbers in a logical and consistent way. Therefore, minor numbers have to be given to V4L2 device drivers on the insmod command line. A single V4L2 device driver module can potentially support multiple devices of a type, and multiple types of devices. For example, a driver may support capture, vbi, and codec device types, in which case minor numbers will need to be specified for all three types of devices. The command line parameters to set minor numbers are the same as the device node name prefixed with "unit_". For example "unit_video" for /dev/video (video capture) devices, or "unit_codec" for codec devices. Valid minor numbers are 0 to 255. For multiple devices driven by a single driver, separate the minor numbers with commas.
For example, a hypothetical driver for a video capture/compression card might export both video capture and video codec interfaces. If you had two such boards in the system, you would need two minors for the capture devices, and two for the codec devices. The parameters might be:
# insmod grabber.o unit_video=0,1 unit_codec=10,11
The device nodes might be:
node major, minor
/dev/video0 81, 0
/dev/video1 81, 1
/dev/codec0 81, 10
/dev/codec1 81, 11
There is no specification for what minor numbers to use with what devices. It is entirely up to the administrator of a system. Obviously, all minor numbers for all devices for all V4L2 drivers must be unique. It is not specified how a driver will handle the case where a minor number is already in use. It may fail the module load. It is expected that driver writers will handle the failure gracefully, and only the offending device will be unavailable.
It is not specified what happens when a needed minor number is not on the command line. It is expected that driver writers will include sensible default values so if you have only one V4L2 driver, it will work without manually assigned minor numbers. However, administrators really should specify the minor numbers. In particular, if you have two V4L2 drivers, you will need to specify minors to guarantee that there are no conflicts.
Video for Linux Two applications open and scan the devices to find what they are looking for. Capability queries define what each interface supports.
но где это указать, хз.
Нужно это всё для видеорегистратора, идея юзать усб-вэбкамеры на 2 мегапикселя, самый простой способ это написать скрипт для каждой камеры типа
#!/bin/sh
while true
do
ffmpeg -t 60 -f video4linux2 -s 1600x1200 -r 15 -b 700k -i /dev/video0 -f avi /home/video/cam2_`date +%Y-%m-%d_%H:%M:%S`.avi
done