14
7
I need ffmpeg to open webcam (logitech c910) in MJPEG mode, because the webcam can give ~24 using MJPEG "protocol" and only ~10 fps using the YUYV. Can i choose between them using 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).
4Welcome to Super User! Can you expand on this? In particular, what information does it have that LordNekbeard's doesn't? :) – bertieb – 2018-04-16T12:00:48.520
No need for
-strict -2
unless: 1) yourffmpeg
is horribly outdated, and 2) you are encoding AAC audio. – llogan – 2018-04-16T18:06:48.133