Grabbing an image frame from a running pipeline on demand

Tim Müller tim at centricular.com
Thu Jun 9 10:48:53 UTC 2016


On Thu, 2016-06-09 at 11:23 +0100, Charlie Turner wrote:
Hi Charlie,
> 
> If I run a time "tee'd" pipeline like this,
> 
>  gst-launch-1.0 -e v4l2src  device=/dev/video0 ! tee name=t    \
>      t. ! queue ! x264enc ! filesink location=fakesink_test.raw     \
>      t. ! queue ! fakesink
> 
> I see the following output in my terminal,
>  (snip)
> 
> And when I look at the "fakesink_test.raw" file, I see that it's zero
> bytes. Something appears to be getting blocked in the above minimal
> example.
> 
> If I remove the x264enc element, the pipeline works as I expect it
> to, producing a suitably large file,
> 
> 
The problem is that x264enc with default settings consumes about 3
seconds of video before outputting anything, but queue's default size
is only ~1 second. Which means the fakesink branch queue will run full
and block, and the x264enc branch will never receive enough data for
x264enc to output a buffer (and make the pipeline as a whole preroll).
You can work around this by making the queue before fakesink unlimited
in size:
  ! queue max-size-bytes=0 max-size-time=0 max-size-buffers=0 !
fakesink
or by configuring x264enc differently, e.g.
  x264enc tune=zerocopy
(other parameters will also help, this is just the easiest, but it will
affect quality)
Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160609/3ee81048/attachment-0001.html>


More information about the gstreamer-devel mailing list