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 677698 - PATCH: camerabin: Set src_filter and zoom_src_filter caps while creating the pipeline
PATCH: camerabin: Set src_filter and zoom_src_filter caps while creating the...
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-06-08 12:03 UTC by Hans de Goede
Modified: 2012-10-21 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstcamerabin: Fix spelling error in debug logging (911 bytes, patch)
2012-06-08 12:03 UTC, Hans de Goede
none Details | Review
camerabin: Add a camerabin_create_view_finder_caps() helper function (3.98 KB, patch)
2012-06-08 12:03 UTC, Hans de Goede
none Details | Review
camerabin: Add gst_camerabin_get_video_source_properties() helper function (3.67 KB, patch)
2012-06-08 12:04 UTC, Hans de Goede
none Details | Review
camerabin: Set src_filter and zoom_src_filter caps while creating the pipeline (3.19 KB, patch)
2012-06-08 12:05 UTC, Hans de Goede
none Details | Review

Description Hans de Goede 2012-06-08 12:03:13 UTC
Created attachment 215939 [details] [review]
gstcamerabin: Fix spelling error in debug logging

We (Fedora) have been receiving bug reports for cheese, about cheese taking 30-60 seconds before showing video, and pausing the same amount of time when changing the resolution for example.

I've managed to reproduce this with a Logitech Webcam Pro 9000, which supports a large list of resolutions at about 5 different framerates / resolution, in my case with an unmodified gst-plugins-bad-0.10.23, the camerabin_create_src_elements function takes approx 7 seconds.

Running under gdb and interrupting the execution during these 7 seconds consistenly points to gst_caps_intersect_full.

Part of the problem is cheese setting the GST_CAMERABIN_FLAG_SOURCE_COLOR_CONVERSION flag, which means that after the first ffmpegcsp element in the pipe the total number of caps is
x resolutions * y framerates * z formats, where both x (due to the camera) and z (due to ffmpegcsp) being large. intersecting this with the capabilities of other parts of the pipeline simply leads to an explosion of combinations  which pegs my core i5 CPU @3.1GHz for 7 seconds!

This patch-set fixes this issue by setting up the capsfilter elements in the pipe with an initial filter, greatly reducing the number of combinations when doing cap intersecting.

This reduces the time spend in camerabin_create_src_elements from approx 7 to 0.2 seconds. And when patching cheese to use the default camerabin flags, (so removing the first ffmpegcsp element) from approx 0.7 to 0.04 seconds .  

This patch set consists of 4 patches, the first one fixes an unrelated spelling error I noticed while working on this, 2 and 3 are preparation patches and 4 contains the actual fix.
Comment 1 Hans de Goede 2012-06-08 12:03:42 UTC
Created attachment 215940 [details] [review]
camerabin: Add a camerabin_create_view_finder_caps() helper function
Comment 2 Hans de Goede 2012-06-08 12:04:25 UTC
Created attachment 215941 [details] [review]
camerabin: Add gst_camerabin_get_video_source_properties() helper function
Comment 3 Hans de Goede 2012-06-08 12:05:37 UTC
Created attachment 215942 [details] [review]
camerabin: Set src_filter and zoom_src_filter caps while creating the pipeline
Comment 4 Hans de Goede 2012-06-08 12:06:20 UTC
p.s.

These patches are against the 0.10 branch, but likely apply to master too. Also I'm not familiar with camerabin2, but the same issue may exist there.
Comment 5 Tim-Philipp Müller 2012-10-21 13:24:04 UTC
Sorry, but the old camerabin1 is not really maintained any longer, it's been replaced by camerabin2 (which is 'camerabin' in 1.0) ages ago, and since there's unlikely to be another 0.10.x release, I think it's best to just close this.

The caps explosion thing is hopefully fixed in 1.0.