Hi!
Almost complete GStreamer beginner here. I’m trying to build a live video mixer for an art project where I want to be able to mix 2 video clips and later replace them individually.
Ideally the videos should be replaced on the fly so that when one is replaced, the other keeps playing. After reading through the docs, I went with using a couple of uridecodebin3
elements. Both also have instant-uri
flag set to True, so I don’t have to restart the pipeline when replacing either clip.
My pipeline looks like this at the moment:
However, as I keep reloading videos on either uridecodebin3
, it gets progressively slower, i.e. after 4-5 changes to uri
property on the “foreground” decodebin, the playback freezes for more than 1 second (looks like entire pipeline freezes, as both videos are paused).
Another problem is that newly loaded videos aren’t played from the start, but rather get fast-forwarded in sync with the “background” uridecodebin3
.
Neither of this happens if I only have one uridecodebin3
in the pipeline - switching clips is fast and smooth, new videos are always played from the beginning.
Is there anything I’m missing in terms of pipeline construction and/or logic around clip reloading (i’m only setting uri
property on uridecodebins at the moment) that would fix the issue?
Is it actually allowed to have multiple uridecodebin3
s in the same pipeline?
On a slightly offtopic matter, what elements would I normally put after each decodebin, to normalize the videos to the same size/format/framerate? I currently have videoscale
with capsfilter
, but it wouldn’t center the video or zoom it to fill the canvas entirely.
I’ve got GStreamer version 1.26.1, if that matters.