I'm trying to capture an multicast stream with ffmpeg
behind a switch with IGMP Snooping enabled:
root [ /tmpfs/root ] $ ffmpeg -i rtp://239.0.0.1:5006 /tmp/stream.mp4
The stream always disconnects after the routers member port time runs out, so always after my configured 260 seconds.
In my tcdump capture, I can see the first join group packet:
6 0.004965 192.168.1.12 224.0.0.22 IGMPv3 54 Membership Report / Join group 239.0.0.1 for any sources
7 0.005046 192.168.1.31 239.0.0.1 UDP 1382 5006 → 5006 Len=1340
8 0.005390 192.168.1.31 239.0.0.1 UDP 1109 5006 → 5006 Len=1067
...
After that, no IGMP report packets are captured until the time runs out:
...
225360 279.883980 192.168.1.12 224.0.0.22 IGMPv3 54 Membership Report / Leave group 239.0.0.1
In my Linux 6.1.60 kernel, CONFIG_IP_MULTICAST=y
and CONFIG_BRIDGE_IGMP_SNOOPING=y
are enabled.
I tried to adjust the the interval for unsolicited report interval:
echo "10000" > /proc/sys/net/ipv4/conf/eth1/igmpv3_unsolicited_report_interval
As I understand, IGMP reports should be answered to IGMP queries, but where should the IGMP queries come from? From the streaming camera or the switch? Can I force my kernel to send the reports without the queries?
I have found a solution for the problem.
I was missing a "multicast router" that is responsible for the IGMP query packets.
I had to enable
CONFIG_IP_MROUTE=y
in the kernel and configure the pimd daemon. The daemon queries the multicast members in the network.