Capturing still frames from webcam with appsink?

Sebastian Dröge sebastian at centricular.com
Fri Jan 15 23:52:55 PST 2016


On Fr, 2016-01-15 at 16:41 -0800, Matt Sarnoff wrote:
> I currently have a working C program that streams continuous frames
> from a webcam to an appsink. However, I'm only interested in
> capturing single frames when the user presses a key.
> 
> In other words: when idle, the appsink receives no frames, but when a
> key is pressed, the appsink should pull a single new frame from the
> camera source.
> 
> Can you point me toward example code that accomplishes this? All the
> examples I've found for still images use gst-launch-1.0 with "num-
> buffers=1". I've found that there is a delay of 1 or 2 seconds
> between the start of the pipeline and capture of the first frame, so
> I'd like to implement this without starting and stopping the pipeline
> for each capture.

The easiest solution for this would be to just discard all frames in
the appsink except for the ones where your user has pressed a button.
All other solutions I can think of right now seem a bit convoluted.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160116/0612a42b/attachment.sig>


More information about the gstreamer-devel mailing list