Snapshot on a pipeline

William Manley william.manley at youview.com
Thu Aug 23 03:15:39 PDT 2012


On 23/08/12 07:45, gnosis wrote:
> Hi,
>
> I've got a pipeline that can play either a live video from the network or a
> video file
> and send it either on the network or in a video file, this pipeline can be
> set to pause.
>
> How can do a snapshot  of the flux sent : send a frame of the flux sent into
> a picture file?

The way I've done it before is to tee the pipeline off into an appsink 
with drop=true and max-buffers=1.  You can then use the pull-buffer 
action signal to get a buffer.

e.g. if before you had

     souphttpsrc ! filesink

You could change it to

     souphttpsrc ! tee name=t ! filesink t. ! decodebin2 ! appsink 
name=screenshot max-buffers=1 drop=1

You then get the screenshot element and call gst_app_sink_pull_buffer to 
get the buffer which you can save to disk after appropriate conversion 
to png, jpg, etc.




More information about the gstreamer-devel mailing list