I created a GStreamer pipeline that takes multiple input sources: camera audio/video, a logo and a screen capture video that is received as a RTP stream). It combines these sources into one video using the videomixer element.
The screen capture stream however seems to lag 2 seconds behind the rest. In order to fix this I would like to introduce a 2 second delay in the other streams. And that's where I'm currently stuck. I've tried to add a queue element after the camera source and set the "min-threshold-time" attribute to create a 2 second delay, but GStreamer seems to correct this for the other streams. The result is that the entire stream is delayed and the lag between the RTP stream and the camera video开发者_如何学C is still there.
I ended up implementing a buffer probe which enabled me to modify the timestamps of individual packets. See Pipeline Manipulation.
Gstreamer plugin rtpjitterbuffer
has a ts-offset
property that can be used to adjust the timestamp of one incoming camera in order to achieve inter-stream sync between sources:
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-rtpjitterbuffer.html#GstRtpJitterBuffer--ts-offset
a simple solution will be adding a latency on the pipeline with
pipeline = gst_pipeline_new ("mypieline");
gstpipline=GST_PIPELINE (pipeline);
gst_pipeline_set_latency(gstpipline,delay you want to set in Nano Sec);
精彩评论