GStreamer multi pipeline time sync

Peter Biro pettair at gmail.com
Tue Dec 1 09:21:03 UTC 2020


Sure, I can describe it more in detail.

You are right about that the streaming / displaying is mandatory and the
recording is optional (it can be triggered).

Unfortunately the actual use case is a bit more complex: when the user hits
record the recording also should include the video(and maybe audio
too) for the previous 30 seconds(actual time is also configurable) as well.
So there should be a live stream and this 'buffered' recording. Also I
cannot 'pre-mux' the audio with the video since audio is
completely optional and it could be configured to be recorded only when the
recording is started (so there would be video for like 30 seconds from the
buffer and then audio would join in later). The hard requirement is this
(to have X seconds of video before the user hits the record and optional
audio attached to it) but I wanted to implement it in a general way so the
other part of the application should not be aware if the 'buffered' data is
audio or video.

This is why I started with separate pipelines and transferring the data
between them with appsinks and appsrcs, and do the buffering and other
logic on the application side, I guess this is a naive way of implementing
it so if there is any suggestion it is more than welcomed :D

Thanks!

On 2020. Dec 1., at 5:06, gotsring <gotsring at live.com> wrote:

Can you describe what you are trying to achieve? It sounds like you want to
grab video and audio (e.g. webcam and mic), combine/mux those streams, then
be able to view the stream it and optionally record it. Something like:

View/Record pipeline (gst-launch-1.0)
videotestsrc ! timeoverlay ! tee name=videotee ! queue ! autovideosink \
audiotestsrc wave=8 ! tee name=audiotee ! queue ! autoaudiosink \
videotee. ! queue ! x264enc ! matroskamux name=muxer ! filesink
location=save_location.mkv async=false \
audiotee. ! queue ! muxer.


Playback (just to test)
gst-play-1.0 save_location.mkv

This should probably not be used exactly, but that's the gist. You can just
google how to mux streams using GStreamer. I also think that queue has a
property that allows you to effectively add a delay to a stream
(min-threshold-time), is this what you wanted?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201201/5e30b0e5/attachment-0001.htm>


More information about the gstreamer-devel mailing list