I need ffmpeg to open webcam (Logitech C910) in MJPEG mode, because the webcam can give ~24 fps using the MJPEG "protocol" and only ~10 fps using the YUYV. Can I choose between them using the ffmpeg command line?
xx@(none) ~ $ v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)
Index : 1
Type : Video Capture
Pixel Format: 'MJPG' (compressed)
Name : MJPEG
My current command line:
ffmpeg -y -f alsa -i hw:3,0 -f video4linux2 -r 20 -s 1280x720 -i /dev/video0 -acodec libfaac -ab 128k -vcodec libx264 /tmp/web.avi
ffmpeg produces corrupted h264 stream when i record from webcam, but normal h264 strem when i record from x11grab. Another codecs (mjpeg, mpeg4) works well with webcam... But this is another story.
update Full ffmpeg's console output: http://pastebin.com/Hzem6CKF (you can see it opens video device in YUV mode, but the device can provide MJPEG outpud also).