Hi all,
I’m working on a PyQt5 + GStreamer application with a compositor-based video pipeline. I have multiple video layers (background, numbers, logo, win animation), each with separate alpha videos combined via alphacombine.
The issue I’m struggling with is related to time management of a single overlay branch.
Pipeline description
The pipeline is static and roughly looks like this:
filesrc → decodebin → videoconvert → alphacombine → videoconvert → glupload
→ gltransformation → gldownload → compositor
The win overlay is connected to compositor.sink_2 and its visibility is controlled using the compositor pad alpha property.
The main pipeline runs continuously in PLAYING.
Current behavior
The win animation is always decoding and running in the background as soon as the pipeline is set to PLAYING.
When an external event (spin_complete_event) is triggered:
-
I simply set
compositor.sink_2::alpha = 1.0 -
This reveals the win animation at whatever timestamp it currently is
Because the animation is ~10 seconds long and continuously running, the visual result is that the win animation always appears at a seemingly random frame depending on when the trigger happens.
Important clarification:
The animation does not start from frame 0, not even the first time. The alpha is enabled at an arbitrary moment while the animation is already playing.
What I have already tried
-
Pausing / playing the win branch
-
Toggling compositor alpha on/off
-
Keeping the win branch in
PAUSEDuntil triggered
None of these reliably reset the decoder position to frame 0 without affecting the rest of the pipeline.
Seeking the entire pipeline is not an option, because all other layers must keep running uninterrupted.
What I want to achieve
Each time the win overlay is triggered:
-
It should start exactly from frame 0
-
It should play exactly once
-
Other layers must continue uninterrupted
-
No pipeline rebuilds (GL + compositor must remain stable)
Questions
-
Is there a supported / idiomatic way in GStreamer to restart only one branch of a running pipeline?
-
Is a segment seek on the win branch the correct solution here?
-
Should the win overlay be isolated into a
GstBinwith ghost pads to allow local seeking? -
Is there any way to reset
decodebinstate for a single stream without tearing down the pipeline?
Extra context
-
Platform: Linux
-
GStreamer 1.x
-
PyGObject
-
Heavy use of GL elements (
glupload,gltransformation,compositor) -
Real-time UI application (freezes or pipeline reconfiguration are not acceptable)
I’m mainly looking for best practices here. I understand that decodebin will keep decoding once the pipeline is in PLAYING, but I’m unsure what the correct architectural solution is for replaying a single overlay animation from the beginning.
Any insights would be greatly appreciated. Thanks!