[FFmpeg-user] C920 h264 Problem

Moritz Barsnick barsnick at gmx.net
Fri Jan 27 19:23:21 EET 2017


On Thu, Jan 26, 2017 at 14:25:13 +0000, Andy Furniss wrote:
> Maybe what Jimmy is saying is you don't need -pix_fmt h264 as you
> already have -input_format h264. If removing it gives the same logging
> output then it's not needed.
> 
> As has been said, you are getting compressed h264 from the camera, but
> you are using -r 20 which means you are requesting 20 fps not 30. You
> should also probably use -framerate 30 rather than -r 30 - there may
> be a difference in behavior.

You can also query the device (driver) to see what the camera can give
you. You should probably get a result such as this:

https://wiki.matthiasbock.net/index.php/Kategorie:Logitech_C920_(Webcam)#v4l2-ctl_--device.3D.2Fdev.2Fvideo1_--list-formats

See the sections "VIDIOC_ENUM_FMT(n,VIDEO_CAPTURE)", n being 0,1,2. It
seems there's only one H.264 format that camera can deliver, and that's
what you are getting with your command.

I believe you can get actual higher quality by choosing YUV 4:2:2 (it
has a higher vertical chroma resolution than YUV 4:2:0), but a) it can
have bandwidth (i.e. resolution or framerate) restrictions on the USB
bus, and b) you need to encode it yourself.

Other tools ("luvcview -L" and guvcview come to mind) will also report
the natively supported resolutions and frame rates, so the driver
doesn't need to make a guess at what is closest to what you request
(e.g. if driver and camera support 15 & 30 fps, but you request 20).

Moritz


More information about the ffmpeg-user mailing list