Time problem when adding source to videomixer

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

Time problem when adding source to videomixer

longkas
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. \



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

Re: Time problem when adding source to videomixer

Nicolas Dufresne-5


Le sam. 23 mars 2019 07 h 11, longkas <[hidden email]> 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Time problem when adding source to videomixer

longkas
Thank you for your suggestions, set offset is working for me now, and I will
investigate the appsrc/sink approach while I can not find element with a
name 'proxy'



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

Re: Time problem when adding source to videomixer

Mathieu Duponchelle
Another remark, you should use compositor in place of videomixer these days :)

On 3/23/19 3:47 PM, longkas wrote:

> Thank you for your suggestions, set offset is working for me now, and I will
> investigate the appsrc/sink approach while I can not find element with a
> name 'proxy'
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> 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