[gst-devel] Re: [patch] gstreamer v4l2 source frame rate detection

Martin Rubli martin_rubli at logitech.com
Sat May 6 10:33:01 CEST 2006

Hey Edgard,

I've tested the current CVS version and it seems to work fine, both with  
gst-launch and v4l2src-test.

There remains a (purely optical) problem with the debug output of fourcc  
codes. The attached patch fixes those. GST_FOURCC_FORMAT lacks the initial  
'%'. This is why the current version would always display strings like  
"cABC" instead of "ABCD".

Also, I've tried to reproduce the problems I had with use-fixed-fps=false  
but I wasn't able to do it. I think I may have confused this and it  
probably always worked.

Talking about the use-fixed-fps property. Maybe it's because I haven't had  
much sleep last night but does it actually do something useful? If you set  
it to true and v4l2src is unable to read out the frame rate, it fails, ok.  
But does it actually drop/insert frames like its description claims?

Finally, for the sake of illustration (parts of it might be useful for  
inclusion in the README):

I have a webcam (Logitech QuickCam for Notebooks Pro) that is detected by  
the Linux UVC driver as follows:

uvcvideo: Probing generic UVC device 2
uvcvideo: Found format MJPEG.
uvcvideo: - 160x120 (30.0 fps)
uvcvideo: - 176x144 (30.0 fps)
uvcvideo: - 320x240 (15.0 fps)
uvcvideo: - 352x288 (30.0 fps)
uvcvideo: - 432x240 (30.0 fps)
uvcvideo: - 480x360 (30.0 fps)
uvcvideo: - 512x288 (30.0 fps)
uvcvideo: - 640x360 (30.0 fps)
uvcvideo: - 640x480 (15.0 fps)
uvcvideo: - 704x576 (15.0 fps)
uvcvideo: - 864x480 (15.0 fps)
uvcvideo: - 960x720 (15.0 fps)
uvcvideo: Found format Uncompressed.
uvcvideo: - 1024x576 (10.0 fps)
uvcvideo: - 1280x960 (7.5 fps)

Note that the frame rates in parenthesis are just the default ones and  
lower frame rates are also supported. By default, v4l2src always picks the  
highest resolution for a given format.

A couple of example pipelines:

gst-launch v4l2src ! xvimagesink
# captures in 1280x960 at 7.5 with YUY2

gst-launch v4l2src ! video/x-raw-yuv,width=1024,height=576 ! xvimagesink
# captures in 1024x576 at 10 with YUY2

gst-launch v4l2src ! jpegdec ! xvimagesink
# captures in 960x720 at 15 with MJPEG

gst-launch v4l2src ! image/jpeg,width=640,height=360 ! jpegdec !  
# captures in 640x360 at 30 with MJPEG

I can't control the capture frame rate yet, e.g. by  
"image/jpeg,width=640,height=360,framerate=25/1". Does anyone see a reason  
why that wouldn't work? If not I'll try to investigate that next week.


On Fri, 05 May 2006 13:17:37 -0700, Edgard Lima <edgard.lima at indt.org.br>  

> Ok, Martin and Fredrik, thanks
> Ive just commited to v4l2src.
> It has some improvements proposed by wingo in bug #338818 and the patch  
> Martin sent me to fix framerate detection.
> Could you please try it?
> Could you please try tests/icles/v4l2src-test with your webcam
> BR,
> Edgard Lima - alima
> edgard.lima at indt.org.br
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 03-fourcc_debug_output.patch
Type: application/octet-stream
Size: 1897 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20060506/68cbfce8/attachment.obj>

More information about the gstreamer-devel mailing list