How to make v4l2src reload buffer in PAUSED state

dlw dlwalter at protonmail.com
Thu Aug 13 19:53:14 UTC 2020


I'm a bit of a gstreamer noob, so please bear with me...

I am trying to capture single images in a pipeline with that looks like the
following:

v4l2src num-buffers=1 ! jpegenc quality=100 ! multifilesink
location="/tmp/IMG%06d.jpg"

In my code I create the pipeline elements, link them and then set the
pipeline to GST_STATE_PAUSED.

When I receive a "capture_image" command I then set the GST_STATE_PLAYING.

This works fantastic and I get an EOS and image written.  I then set the
pipeline to GST_STATE_PAUSED waiting for the next "capture_image" command.

/The problem is that now the v4l2src buffer is empty and nothing will get
written to the multifilesink on subsequent "capture_image" commands./

*Is there a way to make v4l2src send another image to its buffer and send it
down to multifilesink?*  I can only get this to work if I set the pipeline
to GST_STATE_READY, but timing is critical - it takes 600ms to capture the
images from GST_STATE_READY, but only 300ms to capture from GST_STATE_PAUSED
(multiple cameras and other processing happening that I've excluded for
simplicity).





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list