Synchronized Pipelines

Stirling Westrup swestrup at gmail.com
Fri Nov 13 22:43:08 UTC 2020


I'm working on a project similar in intent to RidgeRun's gst-interpipe
elements.  http://ridgerun.github.io/gst-interpipe/
and I'm having huge difficulties with buffers being dropped due to
timestamp issues.

We have a number of 'sender' pipelines which are either live or
recorded sources, and which can come and go at random. Then we have a
number of 'receiver' pipelines that can be switched from one 'sender'
to another while running.

Currently we're implementing the sender pipelines by terminating them
with an element derived from GstBaseSink which basically broadcasts
buffers and events. The intent is for the senders to neither know nor
care if anyone is listening.

The source elements for the receiver pipelines have the job of tuning
into one of the senders and sending the received buffers and events
down the line.

We're treating the source elements as live sources and subclassing
GstBaseSrc for them. That's where everything seems to go wrong.

We need all the receivers connected to any one sender to all be
perfectly synchronized, so they need to somehow come up with the exact
same PTS for the buffers, based on a shared clock.

In particular, a receiver that connects to a sender 10-minutes after
another needs to be still generate the same final timestamps (relative
to the system clock).

As far as I can tell live sources each start their own timelines for
sending out buffers, based on their individual running times, and
anything we try to do to deviate from this runs afoul of assumptions
built into the base classes.

Do you have any recommendations of the best/easiest way to do what
we're doing? Should we not be modelling things as sinks and sources
but as pairs of connected transformational elements? At this point I'm
quite confused as to if I'm even approaching this correctly.

-- 
Stirling Westrup (he/him)
Programmer, Entrepreneur.
http://www.linkedin.com/in/swestrup
(+1) 514-626-0928


More information about the gstreamer-devel mailing list