GNOME Bugzilla – Bug 464630
Snapshot API improvement
Last modified: 2012-09-24 23:04:48 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.
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
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
Fredrik, do you have any interest in discussing this still? How would the ideal API for your use-cases look like?
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.
Fredrik, ping, do you have any update for the bug ?
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.
Fredrik, any further update for the bug ?
Fredrik, ping
I think bug #667203 covers this to some extent.