[gst-devel] Managing single buffers (snapshot functionality)

Olivier Aubert olivier.aubert at liris.cnrs.fr
Tue Jan 16 15:09:28 CET 2007


Hello

I am the developer of a video annotation application
( http://liris.cnrs.fr/advene/ ). We are mainly using VLC for the
moment, but I am in the process of writing a gstreamer wrapper, which
opens a number of great possibilities (see
http://svn.gna.org/viewcvs/advene/trunk/lib/advene/player/gstreamer.py?view=auto )

The problem I am facing is the snapshot functionality. The playbin
plugin offers a 'frame' property which points a gstBuffer containing the
last decoded frame, in whatever format has been negociated in the
pipeline. Now, I need this frame in PNG.

I have seen code that sets a video/x-raw-rgb capability, to be able then
to use the Python Image Library to convert the result to png. But I find
that it is a pity to have yet another dependency, when gstreamer has
this capability.

I have been trying to do something like:

pngconverter = gst.parse_launch("freeze name=source ! video/x-raw-rgb,width=160 ! pngenc name=encoder ! fakesink name=sink")

and then feed pngconverter.get_pad('src') with the playbin.props.frame,
and get the encoded frame through the handoff signal of fakesink. No
success so far... So I am asking the list for some advice: do  you think
I am on the right track, or should I do something else? I have been
thinking of using a tee to duplicate the video output to both the
videosink and the conversion pipeline, but I would then need to find a
way to only activate the converstion pipeline on demand, since I do not
want to encode every frame.

Any advice would be welcome.

For information, I am also planning of writing a SVG overlay module (I
have implemented this functionality for VLC, but it looks like it could
be easy in gstreamer).

Thanks

Olivier





More information about the gstreamer-devel mailing list