Page 1 of 1

VLC does not detect SAP announcement

Posted: 19 Aug 2019 19:03
by yansi
Hello,

On what multicast IP and what port does the VLC listen for SAP?

I am sending periodically this SAP packet (please see screenshot below), however no success to get it shown in the VLC playlist@SAP.

The packet seems to be formed correctly - Wireshark seems to catch it and decode correctly. I am sending to 224.2.127.254 to port 9875 as per RFC2974. I don't know where to look for the mistake. Can you please help?

Image

Thank you for any hints. (hopefully the image will display correctly)

Re: VLC does not detect SAP announcement

Posted: 19 Aug 2019 20:13
by Rémi Denis-Courmont

Code: Select all

udp 0 0 224.0.0.255:9875 0.0.0.0:* udp 0 0 239.255.255.255:9875 0.0.0.0:* udp 0 0 239.195.255.255:9875 0.0.0.0:* udp 0 0 224.2.127.254:9875 0.0.0.0:* udp6 0 0 ff02::2:7ffe:9875 :::* udp6 0 0 ff02::2:7ffe:9875 :::* udp6 0 0 ff04::2:7ffe:9875 :::* udp6 0 0 ff05::2:7ffe:9875 :::* udp6 0 0 ff06::2:7ffe:9875 :::* udp6 0 0 ff07::2:7ffe:9875 :::* udp6 0 0 ff08::2:7ffe:9875 :::* udp6 0 0 ff09::2:7ffe:9875 :::* udp6 0 0 ff0a::2:7ffe:9875 :::* udp6 0 0 ff0b::2:7ffe:9875 :::* udp6 0 0 ff0c::2:7ffe:9875 :::* udp6 0 0 ff0d::2:7ffe:9875 :::* udp6 0 0 ff0e::2:7ffe:9875 :::*

Re: VLC does not detect SAP announcement

Posted: 19 Aug 2019 22:19
by yansi
Thank you for the table. So it indeed listens on the IP/port mentioned in the RFC, despite not showing my SAP announcement.

Is there a way to debug the SAP on the VLC side, too see if the VLC indeed receives these packets and the (possible) reason why VLC does ignore it (if it is received)? Is there any trace for this available?

Could anyone please check the sample SAP packet is built properly? (The UDP payload in HEX is below, if anyone interested)

Code: Select all

20 00 12 34 c0 a8 01 04 61 70 70 6c 69 63 61 74 69 6f 6e 2f 73 64 70 00 76 3d 30 0d 0a 73 3d 54 65 73 74 20 53 65 73 73 69 6f 6e 0d 0a 63 3d 49 4e 20 49 50 34 20 32 33 39 2e 30 2e 30 2e 31 0d 0a 6d 3d 61 75 64 69 6f 20 35 30 30 34 20 52 54 50 2f 41 56 50 20 31 30 0d 0a

The SDP data file contains the following, \r\n used as a line end:

Code: Select all

v=0 s=Test Session c=IN IP4 239.0.0.1 m=audio 5004 RTP/AVP 10

This short descriptor should be (is) enough for VLC to play a stream normally (without SAP announcement).

Re: VLC does not detect SAP announcement

Posted: 19 Aug 2019 23:14
by yansi
Okay, never mind... just if I would look in the damn debug log file sooner. dammit! :evil:

So after tweaking the SDP a bit to not omit any mandatory SDP parameter, it still does not work.

I do have implemented all mandatory: v, o, s, t, m and c.

Code: Select all

v=0 o=- 0 0 IN IP4 192.168.1.4 s=Test Session t=0 0 c=IN IP4 239.0.0.1 m=audio 5004 RTP/AVP 10

yet VLC still tells me "sap debug: missing SDP media description". Does not make sense. A correct "m" line is already present. What does VLC think is missing?

Re: VLC does not detect SAP announcement

Posted: 19 Aug 2019 23:32
by yansi
Okay, finally with a bit of (mostly moral) help from a friend, I found a solution for the problem from previous post:

I had the SDP descriptor lines in this order: V O S T C M. --> VLC says missing media description.

If I swap the C and M, it works in this order correctly: V O S T M C.

It is probably quite brave to say that I have found a bug in VLC SDP parser now, but look, in RFC4566 there is this example of SDP:

Code: Select all

v=0 o=jdoe 2890844526 2890842807 IN IP4 10.47.16.5 s=SDP Seminar i=A Seminar on the session description protocol u=http://www.example.com/seminars/sdp.pdf e=j.doe@example.com (Jane Doe) c=IN IP4 224.2.17.12/127 t=2873397496 2873404696 a=recvonly m=audio 49170 RTP/AVP 0 m=video 51372 RTP/AVP 99 a=rtpmap:99 h263-1998/90000
clearly, C line is before M line. And it seems C before M is even a valid option.

Why does this order (V O S T C M) not work with VLC?

Re: VLC does not detect SAP announcement

Posted: 20 Aug 2019 18:49
by Rémi Denis-Courmont
It does not work because it is syntactically invalid.

Re: VLC does not detect SAP announcement

Posted: 21 Aug 2019 01:22
by yansi
...which is what it seems it indeed is. :-/

It must either be V O S C T M ot V O S T M C order.

V O S T C M order is violating the specified order. Silly me have not read the RFC thoroughly enough and programming at well past midnight after a full work day shall be prohibited and sleep hours mandatory, as is the strong order of the SDP lines :)

Thanks for helping, it is currently working fine (until I'll break it somewhere again, sigh).

Re: VLC does not detect SAP announcement

Posted: 19 Feb 2020 10:42
by sthaliya
Please share the complete vlc cli command to stream multicast with sap announcement.

Re: VLC does not detect SAP announcement

Posted: 20 Feb 2020 04:55
by sthaliya
can any one share the cli format on how to streaming rtp multicast with SAP announcement ?

Re: VLC does not detect SAP announcement

Posted: 20 Feb 2020 19:46
by Rémi Denis-Courmont
Can you not hijack discussion threads?