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 464630 - Snapshot API improvement
Snapshot API improvement
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal enhancement
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-08-08 08:48 UTC by Fredrik Persson
Modified: 2012-09-24 23:04 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Fredrik Persson 2007-08-08 08:48:30 UTC
The function "fetch a snapshot out of a video stream" currently requires an unproportionally huge knowledge of gstreamer inner workings to accomplish.

The first problem is to fetch a frame (a buffer) out of the video stream. This can be trivially accomplished if playbin is used, with the "frame" property. If playbin is not used, however, it is not straightforward nor intuitive to fetch the buffer.

Next, the buffer must be run through a special pipeline. This poses two difficult problems:

1. To "manually" feed a single buffer into a pipeline is very difficult, and various tricks exists that can solve the problem. None is straightforward nor intuitive.

2. The special pipeline must be created so that the buffer is properly converted into a gtk pixbuf. This is not straightforward nor intuitive.

All the things outlined above are not of interest to the application programmer trying to solve his problem; they are irritating obstacles. My personal experience is that this obstacle was so huge I considered not using gstreamer at all for the application I'm developing. I have also noticed that the question "how do I get a snapshot from a video stream?" regularly appears on the mailing list and in the IRC channel.

Conclusion; I suggest that a snapshot element (or some other, equivalent method) is introduced into gstreamer to hide this mess from the application programmer.
Comment 1 Wim Taymans 2007-10-11 11:19:54 UTC
for the interested, this is an example app for making snapshots:

http://webcvs.freedesktop.org/gstreamer/gst-plugins-base/tests/examples/snapshot/snapshot.c?revision=1.3&view=markup
Comment 2 Sebastian Dröge (slomo) 2011-05-18 20:25:18 UTC
And we now also have API to convert a raw video frame to something else, like a PNG:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstvideo.html#gst-video-convert-frame

Is there something else that should be done? You can get the frame from playbin2 and encode/convert it to something else with that API
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2011-07-04 17:21:11 UTC
Fredrik, do you have any interest in discussing this still? How would the ideal API for your use-cases look like?
Comment 4 Fredrik Persson 2011-07-04 17:51:03 UTC
Stefan, yes I am. I do not actively work on the project in question any more, but I will try to find the time to re-open it and provide feedback.
Comment 5 Akhil Laddha 2011-11-02 06:42:49 UTC
Fredrik, ping, do you have any update for the bug ?
Comment 6 Fredrik Persson 2011-11-02 08:04:00 UTC
I have written a small test app to try this function, but have not come to a conclusive descision. Need more time. Looks promising, though.
Comment 7 Akhil Laddha 2012-03-05 05:42:38 UTC
Fredrik, any further update for the bug ?
Comment 8 Akhil Laddha 2012-06-18 16:33:54 UTC
Fredrik, ping
Comment 9 Tim-Philipp Müller 2012-09-24 23:04:48 UTC
I think bug #667203 covers this to some extent.