0

I'm trying to stream some data from a USB webcam to a file on a BeagleBone Black-based device. I'm just trying to test the USB connection, so I don't care about the output format, and don't want to re-encode the output since that would load the CPU. The device has no video card, no screen, only a serial console and a USB port. It's running Debian Jessie (ancient, I know).

I've tried ffmpeg -f v4l2 -i /dev/video0 -vcodec copy -t 60 -stats test.raw but ffmpeg returns

[NULL @ 0x878c0] Unable to find a suitable output format for 'test.raw'
test.raw: Invalid argument

The webcam is a logitech V-U0015, and it enumerates as /dev/video0.

Edit, requested information:

~# ffmpeg -f v4l2 -list_formats all -i /dev/video0
ffmpeg version 2.6.9 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10+deb8u1)
  configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security ' --ex
tra-ldflags='-Wl,-z,relro' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enab
le-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --
enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stri
pping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpe
g --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo
-amrwbenc --enable-libaacplus --libdir=/usr/lib/arm-linux-gnueabihf --disable-vda --enable-libbluray --enable-libcdio 
--enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libpuls
e --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --enable-libvidstab --enable-libzvbi --enable-avresample 
--disable-htmlpages --disable-podpages --enable-libutvideo --enable-libfdk-aac --enable-libx265 --enable-libiec61883 -
-enable-libdc1394 --disable-altivec --shlibdir=/usr/lib/arm-linux-gnueabihf
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[video4linux2,v4l2 @ 0x7cec0] Raw       :   yuyv422 :           YUYV 4:2:2 : 640x480 160x120 176x144 320x176 320x240 3
52x288 432x240 544x288 640x360 752x416 800x448 800x600 864x480 960x544 960x720 1024x576 1184x656 1280x720 1280x960
[video4linux2,v4l2 @ 0x7cec0] Compressed:     mjpeg :          Motion-JPEG : 640x480 160x120 176x144 320x176 320x240 3
52x288 432x240 544x288 640x360 752x416 800x448 800x600 864x480 960x544 960x720 1024x576 1184x656 1280x720 1280x960
/dev/video0: Immediate exit requested
0

1 Answer 1

2

Your camera offers two formats: raw (yuyv422) and mjpeg.

For raw:

ffmpeg -f v4l2 -input_format yuyv422 -i /dev/video0 -c copy -t 60 output.yuv

For mjpeg:

ffmpeg -f v4l2 -input_format mjpeg -i /dev/video0 -c copy -t 60 output.mjpeg
  • I'm guessing the raw input will be selected by default (but I might be wrong) so if you want to be lazy you can omit -input_format yuyv422 if you want the raw format.
  • -stats is on by default so you don't need to include this option.
  • See a list of muxers with ffmpeg -muxers and info on individual muxers with ffmpeg -h muxer=rawvideo and ffmpeg -h muxer=mjpeg.
  • See FFmpeg video4linux2 documentation for more details.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .