Handling branches with different latencies

Nicolas Dufresne nicolas at ndufresne.ca
Mon Nov 27 16:32:05 UTC 2017


Le lundi 27 novembre 2017 à 06:10 -0700, Baby Octopus a écrit :
> I understand that the pipeline sets MAX(all_sink_min_latency) as the global
> latency. Is it possible to have a varying latency for each branch and have
> different sink render with different latency?
> 
> > v4l2src ! tee name=splitter \
> > splitter.! queue ! x264enc tune="zerolatency" ! sink1
> > splitter.! queue ! x264enc ! sink2 
> 
> Here, in the absence of 2nd branch(last line), 1st branch(2nd line) would
> have had only 100ms latency. But due to branch2, sink1 too has a latency of
> 1700ms. With both branches being present, is it possible to make sink1 still
> render with latency=100ms? What are the steps achieve that?

As Tim said, you need to increase the second queue size, as it might
not be able to hold the amount of buffering x264enc needs with it's
default settings.

On top of that, you probably want to set "async=false" on both sink1
and sink2, this way they won't wait for each other before starting. For
sink2, you'll probably want sync=false too, as you don't want it to
through away late buffers.

If instead you care about having a fixes latency on each sink, you can
implement do-latency callback on the pipeline (GstBin class signal).
This is pretty difficult, but would let you specify that sink1 has Nms
latency while sink2 has Mms latency.

regards,
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20171127/053ca6c3/attachment.sig>


More information about the gstreamer-devel mailing list