StackedCrooked
StackedCrooked

Reputation: 35515

GStreamer, how to add a delay to one of the input streams?

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 is still there.

Upvotes: 2

Views: 6374

Answers (3)

Usama
Usama

Reputation: 662

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);

Upvotes: 0

RGD2
RGD2

Reputation: 469

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

Upvotes: 0

StackedCrooked
StackedCrooked

Reputation: 35515

I ended up implementing a buffer probe which enabled me to modify the timestamps of individual packets. See Pipeline Manipulation.

Upvotes: 4

Related Questions