Time problem when adding source to videomixer

Nicolas Dufresne nicolas at ndufresne.ca
Sat Mar 23 13:32:14 UTC 2019


Le sam. 23 mars 2019 07 h 11, longkas <longkas at gmail.com> a écrit :

> Hello,
> The pipeline has one videomixer, at first it only takes a videotestsrc as
> sink, now I want to play a video from file to add to the mixer, but the
> video does not play from start, instead it starts from the time when added
> to the pipeline, how can I make it play from start
>
> videomixer name=mix ! autovideosink \
>    videotestsrc ! videoconvert ! mix. \
>    filesrc name=fsrc location=v.mp4 ! decodebin ! videoconvert ! mix. \
>

You'll need to set a pad offset on your source pad that match the time you
want to start mixing. If this time is now, it will start mixing
immediately, if it's in the past it will clip (but this is not a seek, so
the clipping can take a lot of time) and if it's in the future, it will
hold until that moment before mixing.

If you want to clip, best is to place a blocking  pad probe on your src
pad, wait for it's callback and operate a seek. The seek must happen
outside the callback. The pad offset will then be relative to the seek
position.

For live mixing though, we generally set this offset in the future. It
gives a little reaction time, but also leaves enough time for the new
source to preroll. On more advanced use case, you'll likely have your user
preroll and seek in a seperate player pipeline, which ends with tee and an
appsink. Then you source for mixing is an appsrc. This way you can
completely decorelate the streaming pipeline from the sources. In recent
GST there is proxy element that may work And me be less work the
appsrc/sink.


>
>
> --
> 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/20190323/e0013ac5/attachment-0001.html>


More information about the gstreamer-devel mailing list