Pause and resume live video with latest frames without affecting the sink

Antonio Ospite ao2 at ao2.it
Fri Aug 31 13:39:28 UTC 2018


On Wed, 22 Aug 2018 16:02:05 +0200
Antonio Ospite <ao2 at ao2.it> wrote:

[...]
> Not sure if you have to decouple the pipeline, I've no direct
> experience with that.
>

Experimented with decoupled pipelines and this approach seems to work
fine, see below.

> However from my intuitions this could solve two problems:
> 
> 1. you won't stall the pipeline
> 
> 2. you'd let imagefreeze still be able to get the last buffer when
> you "pause" upstream.
>

imagefreeze, or valve, or identity are not even necessary if you can
change the state of one pipeline without affecting the other.

> For example, compare this pipeline:
> 
> gst-launch-1.0 videotestsrc ! \
>                identity drop-probability=1 ! \
>                imagefreeze ! \
>                videoconvert ! rotate angle=10 ! videoconvert ! \
>                fpsdisplaysink
> 
> With this pipeline:
> 
> gst-launch-1.0 videotestsrc ! \
>                identity drop-probability=1 ! \
>                intervideosink intervideosrc ! \
>                imagefreeze ! \
>                videoconvert ! rotate angle=10 ! videoconvert ! \
>                fpsdisplaysink
> 
> The second one progresses (even though with drop-probability=1 set
> from the beginning the last buffer is not passed to imagefreeze), while
> the first one stalls.
> 
> If this works maybe you could even just pause the "src pipeline" in the
> normal way without the identity hack.
> 

The same principle I was trying to show above seems to work fine in the
attached example. And it is a lot less code.

One detail is to use "timeout=-1" on intervideosrc to keep reusing the
last sample from intervideosink as long as possible.

I'll do some more experiments to see if the problem can be solved by
operating on pads in a single pipeline.

Ciao,
   Antonio

P.S. BTW I should be available for hire soon, if anyone is interested,
drop me a line.

-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gst-decoupled-pipelines.py
Type: text/x-python
Size: 2603 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180831/d29979f3/attachment.py>


More information about the gstreamer-devel mailing list