Pipeline blocking when part of an mp4mux is not receiving data
I have a use case where I'm recording from multiple video and audio udpsrc sources and combining them with an mp4mux. If one of them does not receive any packets, the entire pipeline blocks and there is no output.
I have managed to produce a simple test case that demonstrates this behavior:
gst-launch-1.0 mp4mux name=combo fragment-duration=1000 ! fakesink async=false videotestsrc pattern=ball is-live=true ! video/x-raw, framerate=15/1, width=320, height=240 ! x264enc bitrate=1000 speed-preset=1 ! h264parse ! tee name=tv0 ! queue ! h264parse ! avdec_h264 ! videoconvert ! autovideosink async=false tv0. ! queue ! combo.video_0 udpsrc port=5701 ! application/x-rtp, clock-rate=44100, config=40002410adca00 ! rtpmp4adepay ! aacparse ! queue ! combo.audio_1
The ball moves for a few frames, then stops forever. If you send some packets to port 5701 then the ball starts moving again.
If you remove the mp4mux then everything works fine, each pipeline can run separately with async=false. I reported this with gstreamer 1.16 [2] but at the time mp4mux did not implement GstAggregator, but in 1.18 this was added in [1]. So I believe the pipeline above should work even with no udpsrc input coming in.
[1] e2462005 [2] https://lists.freedesktop.org/archives/gstreamer-devel/2019-August/072575.html