[FFmpeg-devel] [PATCH] allow v4l2 to select a frame rate
Luca Abeni
lucabe72
Mon Dec 21 16:53:24 CET 2009
Hi,
klchxbec at freenet.de wrote:
> Hello.
>
> Attached patch fixes the problem with v4l2 where if the user does
> not specify the frame rate using -r option, it would fail with:
>
> Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
>
> The patch tries to apply the user-specified frame rate. If that does
> not work, it reads the frame rate from the driver. Tested with a
> couple of Logitech webcams.
Unfortunately, this patch appears to break capturing from a Logitech
QuickCam Communicate STX (which captures MJPEG): if I try
./ffmpeg -r 25 -v 10 -f video4linux2 -s 320x240 -i /dev/video0 test.avi
I get
[video4linux2 @ 0x9e76390]The V4L2 driver changed the frame rate from 25.000000 to nan
and ffmpeg hangs.
Without the patch, it works correctly. This is due to VIDIOC_G_PARM
returning a (0,0) frame rate.
Of course, the issue can be addressed by checking if
parm.parm.capture.timeperframe.numerator == 0, but I am wondering
if it would be possible to consider the v4l2 input as variable frame
rate...
Thanks,
Luca
More information about the ffmpeg-devel
mailing list