GNOME Bugzilla – Bug 498297
[v4l2src] put real supported resolutions in caps instead of ranges
Last modified: 2007-12-07 10:28:15 UTC
Currently some webcams return a GstIntRange for their width and height. However not all resolutions within those ranges work. In practice usually a few. The v4l2src element should return only the reported resolutions. See also mail on gst-devel http://sourceforge.net/mailarchive/forum.php?thread_name=8a8adccc0711171336o75ced1aau999b38cb2e4e5f2b%40mail.gmail.com&forum_name=gstreamer-devel
I believe this is fixed in CVS already (for kernels >= 2.6.19 at least). Please re-open if this is not the case or I misunderstood.
ie. I get this with gst-plugins-good CVS + ubuntu gutsy packages for my iSight: $ GST_DEBUG=v4l2*:5 gst-launch-0.10 v4l2src ! fakesink 2>&1 | grep 'probed caps' 0:00:00.184046037 15978 0x6060a0 INFO v4l2src gstv4l2src.c:710:gst_v4l2src_get_caps:<v4l2src0> probed caps: video/x-raw-yuv, format=(fourcc)YUY2, width=(int)720, height=(int)480, framerate=(fraction){ 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1, 5/2, 1/1 }; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)704, height=(int)576, framerate=(fraction){ 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1, 5/2, 1/1 }; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)160, height=(int)120, framerate=(fraction){ 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)176, height=(int)144, framerate=(fraction){ 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)320, height=(int)240, framerate=(fraction){ 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)352, height=(int)288, framerate=(fraction){ 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)640, height=(int)480, framerate=(fraction){ 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; image/jpeg, width=(int)1280, height=(int)1024, framerate=(fraction){ 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; image/jpeg, width=(int)1280, height=(int)960, framerate=(fraction){ 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; image/jpeg, width=(int)1280, height=(int)720, framerate=(fraction){ 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; image/jpeg, width=(int)1024, height=(int)768, framerate=(fraction){ 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; image/jpeg, width=(int)1024, height=(int)576, framerate=(fraction){ 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; image/jpeg, width=(int)800, height=(int)600, framerate=(fraction){ 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; image/jpeg, width=(int)720, height=(int)480, framerate=(fraction){ 60/1, 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }; image/jpeg, width=(int)640, height=(int)480, framerate=(fraction){ 60/1, 30/1, 55/2, 25/1, 45/2, 20/1, 35/2, 15/1, 25/2, 10/1, 15/2, 5/1 }
Tim, Maybe on a low level it is OK but the reports I got was that gstreamer returns an int range for the width and the height. I don't have an iSight myself. Can you compile cheese from SVN? (It's also in jhbuild if you use that) And then check if in the function cheese_webcam_get_supported_video_formats in cheese_webcam if the height and the width are returned as a range, or a list or just an int. Thanks Jaap
> Maybe on a low level it is OK but the reports I got was that gstreamer returns > an int range for the width and the height. > > I don't have an iSight myself. Can you compile cheese from SVN? (It's also in > jhbuild if you use that) > > And then check if in the function cheese_webcam_get_supported_video_formats in > cheese_webcam if the height and the width are returned as a range, or a list or > just an int. In _get_supported_formats() the if (G_VALUE_HOLDS_INT (width)) { .. } code path gets executed. No int ranges for width/height.
OK, Daniel can you also try. If I remember correctly your camera (maybe a different iSight camera) had this problem
Sorry, I think I got confused. iSight cameras don't return ranges for width and height. It's other cameras Patryk we had some emails about this. Can you tell us which cameras do have this behavior and paste the output of GST_DEBUG=v4l2*:5 gst-launch-0.10 v4l2src ! fakesink 2>&1 | grep 'probed caps'
(In reply to comment #6) > Sorry, I think I got confused. iSight cameras don't return ranges for width and > height. It's other cameras Wouldn't that most likely just be an issue with the driver for that camera not implementing the (new-ish) VIDIOC_ENUM_FRAMESIZES ioctl? > Patryk we had some emails about this. Can you tell us which cameras do have > this behavior and paste the output of > > GST_DEBUG=v4l2*:5 gst-launch-0.10 v4l2src ! fakesink 2>&1 | grep 'probed caps' and gst-inspect-0.10 v4l2src | grep Version and uname -a