Grabbing an image frame from a running pipeline on demand

Charlie Turner charlie at dune.rocks
Thu Jun 9 10:23:02 UTC 2016


Hi Michael & Nicolas,

Thanks for the pointers. The fakesink approach appeals more to me because
it seems simpler, but I'm have a very elementary problem with it!

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,

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
  C-c C-chandling interrupt.             # Pressed C-c first time
Interrupt: Stopping pipeline ...
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...
  C-c C-chandling interrupt.            # Pressed C-c second time,
something seems to have gone wrong :(
Interrupt: Stopping pipeline ...
Interrupt while waiting for EOS - stopping pipeline...
Execution ended after 0:00:03.109734115
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

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,

$ gst-launch-1.0 -e v4l2src  device=/dev/video0 ! tee name=t       t. !
queue ! filesink location=fakesink_test.raw         t. ! queue ! fakesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
  C-c C-chandling interrupt.
Interrupt: Stopping pipeline ...
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 0:00:01.653899816
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Any idea what I've done wrong in the first pipeline? I appear to be
following the same pattern as the example in tee docs.

Thanks in advance,

On 8 June 2016 at 18:57, Nicolas Dufresne <nicolas.dufresne at gmail.com>
wrote:

> Le mercredi 08 juin 2016 à 17:02 +0100, Charlie Turner a écrit :
> >
> > v4l2src device=/dev/video0 num-buffers=1 ! jpegenc ! filesink
> > location="thumbnail.jpg"
>
> You could:
>
> v4l2src ! tee name=t
>   t. ! queue ! some-pipeline
>   t. ! queue ! fakesink
>
> And another pipeline
>
>   appsrc ! jpegenc ! filesink ...
>
> At random point, you can read "last-sample" property from the fakesink,
> and push that sample to the appsrc (followed with an eos).
>
> Nicolas
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>



-- 
Kind regards,
Charlie Turner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160609/f055d64f/attachment.html>


More information about the gstreamer-devel mailing list