Pause filesrc while the rest of the pipeline is running

Let’s say I have a pipeline with a filesrc, and a videotestsrc. I then composite them and send them to a stream. I would like to be able to pause, change the playback speed, etc. of the filesrc, while the rest of the pipeline (and the videotestsrc) continues at the normal rate.

It seems like pausing and changing playback speed are only applied to sink elements, and thus the entire pipeline. Do I need to somehow get a sink element in middle of the pipeline?

What does the rest of your pipeline look like?

filesrc doesn’t know about timestamps or playback speed.

Example pipeline:

compositor name=v_bus_a ! queue ! x264enc ! queue ! mpegtsmux ! srtserversink mode=2 localport=8000
filesrc location=iframe.mp4 ! qtdemux ! h264parse ! openh264dec ! autovideoconvert ! videorate ! video/x-raw,width=1280,height=720,framerate=30/1 ! v_bus_a.sink_0
videotestsrc ! videoconvertscale ! video/x-raw,width=1280,height=720,framerate=30/1 ! v_bus_a.sink_1

So what can I put after the filesrc that does know about timestamps and playback speed?

I think the easiest way might be to do something using intervideosink and intervideosrc.

e.g. intervideosrc ! video/x-raw,framerate=X/1 ! compositor on the streamout side, and on the input side just make a separate pipeline with playbin3 uri=file:/// video-sink=intervideosink.

Then you can do pause/play or seek (with rate for fast-forward/reverse playback) on the playbin3 as you like, and the intervideosrc will continue outputting a stream of frames no matter what.

Bit like a projector projecting a video onto the wall, and a separate camera recording it off the wall. If you pause the playback, the camera will just keep recording the paused frame.

Thank you! intervideosrc was the solution. I also had to set timeout=G_MAXUINT64 to prevent it from sending black frames when paused.