play multiple sources at once, each from a different position

Tomasz Mikolajczyk tmmikolajczyk at gmail.com
Tue Feb 1 08:02:15 UTC 2022


Thanks a lot Nicolas. I briefly skimmed the doc and examples and it does
offer such functionality.
There is an interface allowing to set a video track for a timeline:

GESTrack* video_track = GES_TRACK(ges_video_track_new());
ges_timeline_add_track(timeline, video_track);

Then I can link the video_track static src pad to some other element's
sink, for instance ->videoconvert->autovideosink

auto v_src_pad = ges_timeline_get_pad_for_track(timeline, video_track);
auto v_convert_sink_pad = gst_element_get_static_pad(videoconvert, "sink");
gst_pad_link(v_src_pad, v_convert_sink_pad);

If I understand correctly the autovideosink would display the overlapped
videos from multiple layers as mixed together. However I would need to
obtain an independent appsink-based access to each video, or an independent
appsink-based access to each layer. Is something like that possible?

On Sun, Jan 30, 2022 at 2:40 PM Nicolas Dufresne <nicolas at ndufresne.ca>
wrote:

> Le samedi 29 janvier 2022 à 00:30 +0100, Tomasz Mikolajczyk a écrit :
> > Thank you. Could you tell if something like that is doable in gstreamer
> > itself?  If yes, could you explain here how to achieve it? I just need
> to play
> > two sources together but both starting with different offset. Thank you
> in
> > advance.
>
> GES is implemented using GStreamer, so the answer is yes. You can read GES
> code,
> specially the NLE set of GstElement if you need to learn how this is done.
> It is
> non-trivial though, hence why there is a library with elements to solve
> this.
>
> >
> > On Tue, Jan 25, 2022 at 4:55 PM Nicolas Dufresne <nicolas at ndufresne.ca>
> wrote:
> > > Le lundi 24 janvier 2022 à 02:18 +0100, Tomasz Mikolajczyk via
> gstreamer-
> > > devel a écrit :
> > > > Hi,
> > > >
> > > > I would like to use gstreamer to play multiple sources (for instance
> two
> > > > video files) simultaneously using a single pipeline but each video
> > > > starting from a different position, for instance first video from the
> > > > beginning and the second from the middle. Could someone guide me on
> how to
> > > > achieve it?
> > > > Simplifying, my pipeline is an equivalent of:
> > >
> > >
> > > This use case is better handled by GES, which offers ges-launch-1.0
> command
> > > line to test.
> > >
> > >
> https://gstreamer.freedesktop.org/documentation/gst-editing-services/?gi-language=c
> > >
> > > > gst-launch-1.0 \
> > > > uridecodebin
> > > > uri=file:///Users/tmikolaj/Downloads/videoalpha_video_dancer1.webm !
> > > > videoconvert ! autovideosink \
> > > > uridecodebin
> > > > uri=file:///Users/tmikolaj/Downloads/videoalpha_video_dancer1.webm !
> > > > videoconvert ! autovideosink
> > > >
> > > > , but created programmatically.
> > > > Obviously, a simple pipeline's seeking seeks two files at once.
> > > > I was trying to register a probe of the
> GST_PAD_PROBE_TYPE_EVENT_UPSTREAM
> > > > type from inside the "pad-added" signal callback of the
> "uridecodebin"
> > > > element. Inside the probe I wanted to catch the "GST_EVENT_SEEK"
> event and
> > > > drop it for the first video. However, it seems that dropping the SEEK
> > > > message leaves the pipeline in a "PAUSED" state and even an explicit
> state
> > > > change to "PLAYING" does nothing.
> > > > Does anybody have some hints on how to solve that problem?
> > > > Regards,
> > > > Tomasz
> > >
> > >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220201/f5ddf766/attachment.htm>


More information about the gstreamer-devel mailing list