[gst-devel] pixbuf from video file

Tim Müller t.i.m at zen.co.uk
Thu Aug 2 12:48:31 CEST 2007

On Tue, 2007-07-31 at 20:32 +0100, Luis de Bethencourt wrote:

> ... I would need to get a pixbuf from the frame at the middle
> of the video. First frame is not as representative because of
> fade ins. How can I do this in gstreamer?

You might want to have a look at totem's video-thumbnailer for
inspiration. It's a bit clunky, but fairly straight-forward (basically
it just uses playbin, sets it to PAUSED state, seeks, gets the last
frame via playbin's "frame" property and shoves that into a conversion
pipeline to get a GdkPixbuf).

You can probably achieve the same thing with a pipeline like:

 filesrc location=video.file ! decodebin ! ffmpegcolorspace !
videoscale !
video/x-raw-rgb,width=64,height=64,bpp=24,depth=24,red_mask=... !

and then get a RGB24 buffer via fakesink's preroll-handoff signal (which
is emitted in PAUSED state), which in turn is easily convertible into a
GdkPixbuf or whatever you need.


More information about the gstreamer-devel mailing list