What's the correct way to play sources from different offsets/times?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

What's the correct way to play sources from different offsets/times?

Trey Hutcheson
I have two video files that were created by a single pipeline; they were started approximately 5 seconds apart. Each video has a time overlay.

I would like to play these two videos back in the same pipeline (for now, each to a different video sink/window), but respect their different start times.

I've built a pipeline that watches the clock, and when the clock advances past a certain threshold (roughly 5 seconds), it wires in the second video and starts playing it from a filesrc. However, when the second video starts, the video itself starts 5 seconds *into* the video, if that makes sense. The time overlay displayed in the video is roughly 5 seconds later than if I play the file in an independent viewer.

So what's the proper way to control the relative position of this second video stream? Seek on the filesrc? Seek on the demuxer. Set a negative start time or offset on an element somewhere?

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: What's the correct way to play sources from different offsets/times?

Olivier Crête-3
Hi,

To add a time difference, you just need to set the "offset" property on the first pad where there is a timestamp, so after the demuxer. You don't even need to have a timer, the sink will wait until the right time is reached.

Olivier

On Tue, 2021-02-02 at 13:20 -0600, Trey Hutcheson wrote:
I have two video files that were created by a single pipeline; they were started approximately 5 seconds apart. Each video has a time overlay.

I would like to play these two videos back in the same pipeline (for now, each to a different video sink/window), but respect their different start times.

I've built a pipeline that watches the clock, and when the clock advances past a certain threshold (roughly 5 seconds), it wires in the second video and starts playing it from a filesrc. However, when the second video starts, the video itself starts 5 seconds *into* the video, if that makes sense. The time overlay displayed in the video is roughly 5 seconds later than if I play the file in an independent viewer.

So what's the proper way to control the relative position of this second video stream? Seek on the filesrc? Seek on the demuxer. Set a negative start time or offset on an element somewhere?
_______________________________________________
gstreamer-devel mailing list

-- 
Olivier Crête


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: What's the correct way to play sources from different offsets/times?

Trey Hutcheson
Perfect! Thank you. 

I had tried setting the offset on other pads, but I guess I was too far upstream. Thanks again.

On Tue, Feb 2, 2021 at 1:41 PM Olivier Crête <[hidden email]> wrote:
Hi,

To add a time difference, you just need to set the "offset" property on the first pad where there is a timestamp, so after the demuxer. You don't even need to have a timer, the sink will wait until the right time is reached.

Olivier

On Tue, 2021-02-02 at 13:20 -0600, Trey Hutcheson wrote:
I have two video files that were created by a single pipeline; they were started approximately 5 seconds apart. Each video has a time overlay.

I would like to play these two videos back in the same pipeline (for now, each to a different video sink/window), but respect their different start times.

I've built a pipeline that watches the clock, and when the clock advances past a certain threshold (roughly 5 seconds), it wires in the second video and starts playing it from a filesrc. However, when the second video starts, the video itself starts 5 seconds *into* the video, if that makes sense. The time overlay displayed in the video is roughly 5 seconds later than if I play the file in an independent viewer.

So what's the proper way to control the relative position of this second video stream? Seek on the filesrc? Seek on the demuxer. Set a negative start time or offset on an element somewhere?
_______________________________________________
gstreamer-devel mailing list

-- 
Olivier Crête

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel