udpsrc lost UDP multicast packets when starting another receiver app
I found a strange problem on udpsrc Gstreamer 1.16.0 , reproduced on several other versions of GStreamer (1.16.1 , 1.12 , 1.10 and 1.8.3 , but not on 1.8.0) so i came back to 1.8.0 for my current project. I suspect some changes in udpsrc in 2016 to be the culprit.
On my Windows 10 64 bits PC , i am running a simple pipeline that receives and displays a UDP/RTP/H264 video stream : gst-launch-1.0 udpsrc do-timestamp=1 port=5004 address=239.20.40.1 buffer-size=800000 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000" ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=0
Of course there is some sender on the local network to generate this stream. Everything goes fine.
If then i start another app that wants to display this video stream ( VLC player for the test , using a small SDP file ) , the Gstreamer pipeline freezes, or more precisely the udpsrc element do not receive anymore the UDP packets. If i stop VLC , the Gstreamer video runs again.
NO problem when starting several Gstreamer pipelines on the same stream (same IP multicast, same port). NO problem in loopback mode, that is , when i generate the stream locally with some Gstreamer pipeline for the test.
I repeat , with Gstreamer 1.8.0 , no problem , the video goes fine , even with VLC running.
I don't think VLC is to be blamed on this . I have reproduced the problem with one of our developped apps here that create and bind to a multicast socket (and set the SO_REUSEADDR option).
I suspect some Multicast settings in udpsrc code to be the culprit but unfortunately i don't have much time to investigate and recompile udpsrc to check my hypothesis.