I'm trying to record some videos using a USB camera, but I'm having some issues when using ffmpeg.
If I run ffmpeg -f video4linux2 -t 00:00:10 -i /dev/video0 out.mpg, the program tries to record at 640x480 resolution and ffmpeg hangs.
However, if I add the -s to ffmpeg and record at lower resolutions than 640x480 (e.g., 320x240), the video is recorded successfully.
After a hang, if I hit CTRL+C, ffmpeg resumes, yielding a file of 0 kB in size. Using strace I can see that an ioctl call to the device keeps returns -EINVAL and subsequent ioctls return -EAGAIN.
ioctl(3, VIDIOC_G_STD, 0xbe84dfb0) = -1 EINVAL (Invalid argument)
ioctl(3, VIDIOC_DQBUF, {type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EAGAIN (Resource temporarily unavailable)
Any ideas why this happens?
I'm using ffmpeg version 2.8.7, built through busybox 1.25. The host architecture is an ARM processor running kernel 3.2.
I also tried compiling the most recent version from source, and the problem persists...