After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676093 - v4l2src: 10 fps with gstreamer-properties, but 30 fps with guvcview
v4l2src: 10 fps with gstreamer-properties, but 30 fps with guvcview
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other Linux
: Normal minor
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-05-15 11:38 UTC by guust
Modified: 2013-04-21 15:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dbg.log (205.45 KB, text/x-log)
2012-05-16 08:44 UTC, guust
Details

Description guust 2012-05-15 11:38:46 UTC
Overview:
With guvcview I get 30fps on 1280x720 resolution, but via gstreamer-properties I only get 10 fps.

I am using Microsoft Lifecam Cinema webcam on 1280x720.
Plugin I'm using is V4L2.
OS: Ubuntu 10.10

I'm not sure if this is a bug or a misconfiguration on my side.
Comment 1 guust 2012-05-15 11:42:51 UTC
Installing gstreamer-tools and doing this:
gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=1280,height=720,framerate=30/1' ! xvimagesink

Is working and gives me a webcam feed with 30fps. 
Starting via gstreamer-properties still only gives me 10 fps.
Comment 2 Tim-Philipp Müller 2012-05-15 12:01:58 UTC
What does

   gst-launch-0.10 -v v4l2src device=/dev/video0 ! fakesink

show?

You might also want to check the debug log:

  GST_DEBUG=v4l2*:5 gst-launch-0.10 -v v4l2src device=/dev/video0 ! fakesink 2>&1 | less -R

perhaps it negotiates to a different/higher resolution where only a lower framerate is available?

(gstreamer-properties is part of gnome-media and deprecated/outdated, I think, fwiw)
Comment 3 Tim-Philipp Müller 2012-05-15 12:03:02 UTC
Oh also: what's the output of:  gst-inspect-0.10 v4l2src | grep Version  ?

The latest gst-plugins-good release is 0.10.31 - it looks like you might be using an old version. Perhaps you could test with the latest releases.
Comment 4 guust 2012-05-15 12:04:40 UTC
Installing gstreamer-tools and doing this:
gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=1280,height=720,framerate=30/1' ! xvimagesink

Is working and gives me a webcam feed with 30fps. 
Starting via gstreamer-properties still only gives me 10 fps.
Comment 5 guust 2012-05-15 12:07:23 UTC
Thank you for your quick reply Tim-Philipp.

gst-launch-0.10 -v v4l2src device=/dev/video0 ! fakesink
Shows:

Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)YUY2, width=(int)1280, height=(int)800, interlaced=(boolean)false, framerate=(fraction)10/1
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)YUY2, width=(int)1280, height=(int)800, interlaced=(boolean)false, framerate=(fraction)10/1
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "preroll   ******* "
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "event   ******* E (type: 102, GstEventNewsegment, update=(boolean)false, rate=(double)1, applied-rate=(double)1, format=(GstFormat)GST_FORMAT_TIME, start=(gint64)0, stop=(gint64)-1, position=(gint64)0;) 0x989a078"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (2048000 bytes, timestamp: 0:00:00.078792782, duration: 0:00:00.100000000, offset: 0, offset_end: 1, flags: 32 discont ) 0x988a298"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (2048000 bytes, timestamp: 0:00:00.178537936, duration: 0:00:00.100000000, offset: 1, offset_end: 2, flags: 0 ) 0x988a2e8"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (2048000 bytes, timestamp: 0:00:00.278799935, duration: 0:00:00.100000000, offset: 2, offset_end: 3, flags: 0 ) 0x988a338"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (2048000 bytes, timestamp: 0:00:00.378555552, duration: 0:00:00.100000000, offset: 3, offset_end: 4, flags: 0 ) 0x988a388"


This continues endless (I think, I waited untill offset 140)


The output of gst-inspect-0.10 v4l2src | grep Version  is:
  Version:		0.10.29

I indeed seems like I'm on an old version...
Comment 6 guust 2012-05-15 15:29:02 UTC
I'm now on verion 0.10.31, but I had to install from source (Synaptics only showed 0.10.29) Probably this does not belong on bugzilla, sorry, but now guvcview and gst-launch v4l2src are not working anymore. Giving me:
WARNING: erroneous pipeline: no element "xvimagesink"

I removed the updated version and returned to the version in Synaptics. Now I'm gettings this error with gst-launch:
(gst-plugin-scanner:2113): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-0.10/libgstvideoscale.so': /usr/local/lib/libgstvideo-0.10.so.0: undefined symbol: gst_buffer_get_qdata

Also guvcview and even Ubuntu software center don't want to start anymore. I did something wrong...
Comment 7 Tim-Philipp Müller 2012-05-15 15:49:07 UTC
Hrm, yes, sorry, you shouldn't really mix a from-source install with packages. There's a GStreamer PPA for ubuntu with newer versions.

If you still have the source tree(s), I would recommend a 'sudo make uninstall' in them.
Comment 8 guust 2012-05-16 06:08:55 UTC
Thank you Tim-Philipp, that fixed my Ubuntu Software Center. I first tried with the GStreamer PPA, but there is no update available. Now I reverted v4l2src to 0.10.29 again, I added the PPA again, but Synaptics does not think there are any updates for gstreamer
Comment 9 Tim-Philipp Müller 2012-05-16 08:03:40 UTC
Ok, then could you make a log like this please from gnome-terminal or so:

 $ GST_DEBUG=v4l2*:5 gst-launch-0.10 v4l2src device=/dev/video0 num-buffers=1 ! fakesink 2>dbg.log

and then attach dbg.log to this bug report? (gzip it if it's larger than 1MB).

Bug #665387 could be related.
Comment 10 guust 2012-05-16 08:44:42 UTC
Created attachment 214169 [details]
dbg.log
Comment 11 Wim Taymans 2012-05-16 09:16:50 UTC
This camera supports two modes:

 - raw YUYV capture with a max framerate of 10/1 at 1280x700
 - MJPG with a max framerate of 30/1 at 1280x700

There are also some emulated modes and other dimenstions and framerates. The emulated modes seem to do a jpeg decompression because they also support higher framerates.

What gstreamer does is negotiate to the first raw YUYV format at 1280x700. You can force it do another format like in Comment 4 (which likely enables the emulation mode).

What can be done is to make it negotiate to something else.. I think 640x480@30 fps would be a more reasonable default.
Comment 12 Tim-Philipp Müller 2012-05-16 09:35:56 UTC
> What can be done is to make it negotiate to something else.. I think 640x480@30
> fps would be a more reasonable default.

Perhaps. How would you find the best resolution * fps trade-off in this case ?

But then what do we do if someone files a bug about getting 1280x720 resolution with guvcview and only 640x480 with GStreamer? Ultimately it's the application that needs to offer the different options to the user or select something best suited to its use case.
Comment 13 guust 2012-05-16 09:56:29 UTC
My personal goal is to get 30fps in my OpenCV c++ program. I think I traced it back to gstreamer, because [see first post]. Is there maybe a way to force gstreamer to always use MJPG or YUV 30fps with this resolution? I'm bound to the 1280x720 resolution, but not necessarily to YUV or MJPG.

Thanks again
Comment 14 Wim Taymans 2012-05-16 10:25:57 UTC
(In reply to comment #13)
> My personal goal is to get 30fps in my OpenCV c++ program. I think I traced it
> back to gstreamer, because [see first post]. Is there maybe a way to force
> gstreamer to always use MJPG or YUV 30fps with this resolution? I'm bound to
> the 1280x720 resolution, but not necessarily to YUV or MJPG.
> 
Yes, add a capsfilter like in Comment 1.
Comment 15 guust 2012-05-16 11:00:06 UTC
Sorry for my ignorance, but how exactly can I do that to work with/in my OpenCV program? Or can I adjust gstreamer in such a way that it always has the capsfilter? (if so, how?)
Comment 16 Tim-Philipp Müller 2013-01-01 14:02:46 UTC
How do you use GStreamer exactly?

Usually a GStreamer-using library or application will create a GStreamer pipeline of some sort. In there there will be a v4l2src element, followed by other elements that use the data v4l2src produces in some way. When that pipeline is constructed, a capsfilter element can be inserted after v4l2src to select or filter the formats/resolutions/fps it should use.

So it seems to me like this is basically NOTABUG, but something that needs to be done application-side or in the component that uses GStreamer.
Comment 17 Stefan Sauer (gstreamer, gtkdoc dev) 2013-04-21 15:49:53 UTC
Agreed that the application should offer a means to pick the capture mode.