Hi,

I am trying to stream RTP over IPv6 link-local multicast, but despite everything I am doing I cannot get ffmpeg to receive it. I write here because I've ran out of options.

To transmit the stream I use the following, with the interface in the local address:

ffmpeg -f alsa -channels 1 -sample_rate 8000 -i default -c:a pcm_mulaw -f rtp "rtp://[ff12::acab:cafe:beef:caca]:10000?localaddr=fe80::d65d:64ff:fe81:7095%enp4s0"

And to receive it, I had to patch libavformat/udp.c to join the multicast group in the correct interface provided by addr.sin6_scope_id (PR#21439). The following was used, with the interface specified in the rtp address:

ffplay -protocol_whitelist file,udp,rtp rtp://[ff12::acab:cafe:beef:caca%enp4s0]:10000

I could confirm packets were being emitted in the enp4s0 interface with the correct destination. And I could see ffplay bind() to the right address and joined the right multicast group as confirmed by ss and ip:

# ss -6a
udp UNCONN 0 0 [ff12::acab:cafe:beef:caca]%enp4s0:10000 [::]:* udp UNCONN 0 0 [ff12::acab:cafe:beef:caca]%enp4s0:10001 [::]:*

# ip -6 maddress
2:      enp4s0
        inet6 ff12::acab:cafe:beef:caca users 2

I was also able to receive the RTP packets if I replicated this bind() and join behaviour in a minimal C example program:

$ ./ipv6_multicast_recv ff12::acab:cafe:beef:caca%enp4s0 10000
�{��g��%{vtup��������������������������������������������~�������������������������������������������������������������������������������|��g��%���������������������������������|z{|zz||xyvrrsponmnmlnnnpostuvyy{�~{������~���~�������������������������������}|~}z{zy|yy{y{|{{�}��hE�%��}�������������������������������������~~~}|xwxwtpoooqomlklljjjikjjkklmmmnmorpnqqrtuy|z|�}�������~}zzzxwwwrrpnnppprsqpppqprpopo�~��hy�%pqprpprtvwxxy|}|~
[...]

But whatever I did, I could not get ffplay (or ffmpeg) to receive the multicast packets. I have tried -loglevel trace but nothing of use appears.

I have confirmed that global multicast works, with routable addresses, such as this (note the ff1e:: scope prefix):

ffmpeg -f alsa -channels 1 -sample_rate 8000 -i default -c:a pcm_mulaw -f rtp "rtp://[ff1e::acab:cafe:beef:caca]:10000?localaddr=fd7c:3f3e:c7e2::1"

ffplay -protocol_whitelist file,udp,rtp rtp://[ff1e::acab:cafe:beef:caca]:10000

So clearly IPv6 multicast works. The problem is somewhere in the handling of link-local multicast group addresses. But I am not familiar enough with the libav source to debug this, I have ran out of options here.

Also for some reason I cannot observe any bind() call in ffplay with strace, strange.

Thank you for reading, any help appreciated!

Angel
_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to