[vlc-devel] [PATCH] sout/rtsp: fix SETUP error

Zhao Zhili quinkblack at foxmail.com
Tue Dec 5 09:33:28 CET 2017



On 2017年12月05日 16:01, Rémi Denis-Courmont wrote:
> Le 5 décembre 2017 08:28:25 GMT+02:00, Zhao Zhili <quinkblack at foxmail.com> a écrit :
>> According to RFC 2326:
>>    port:
>>          This parameter provides the RTP/RTCP port pair for a multicast
>>           session. It is specified as a range, e.g., port=3456-3457.
>>
>> And there is an example in section 14.5:
>>      C->M: SETUP rtsp://server.example.com/demo/548/sound RTSP/1.0
>>            CSeq: 2
>>            Transport: RTP/AVP;multicast;destination=225.219.201.15;
>>                       port=7000-7001;ttl=127
>>          Conference: 199702170042.SAA08642 at obiwan.arl.wustl.edu%20Starr
>> ---
>> modules/stream_out/rtsp.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/modules/stream_out/rtsp.c b/modules/stream_out/rtsp.c
>> index 35ee7e7..26fa61e 100644
>> --- a/modules/stream_out/rtsp.c
>> +++ b/modules/stream_out/rtsp.c
>> @@ -728,6 +728,9 @@ static int RtspHandler( rtsp_stream_t *rtsp,
>> rtsp_stream_id_t *id,
>>                      if( strncmp( opt, "unicast", 7 ) == 0 )
>>                          b_multicast = false;
>>                      else
>> +                    if( sscanf( opt, "port=%u-%u", &loport, &hiport )
>> == 2 )
>> +                            ;
>> +                    else
>>                if( sscanf( opt, "client_port=%u-%u", &loport, &hiport )
>>                                  == 2 )
>>                          ;
>> -- 
>> 2.7.4
>>
>>
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> Hi,
>
> This does not look right. port is only for multicast setup AFAIK.

Without this patch:

SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=0 RTSP/1.0
CSeq: 4
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP;multicast;port=1234-1235

RTSP/1.0 461 Client error
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:57 GMT
Content-Length: 0
Cache-Control: no-cache
Cseq: 4

============================================
With this patch:

SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=0 RTSP/1.0
CSeq: 4
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP;multicast;port=1234-1235
RTSP/1.0 200 OK

Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:05 GMT
Transport: 
RTP/AVP/UDP;destination=239.255.1.1;port=1234-1235;ttl=1;mode=play
Session: 534646116;timeout=60
Content-Length: 0

So what should we do?
-------------- next part --------------
OPTIONS rtsp://localhost:8080/test.sdp RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Content-Length: 0
Cseq: 2
Public: DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE,GET_PARAMETER

DESCRIBE rtsp://localhost:8080/test.sdp RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Accept: application/sdp

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:57 GMT
Content-Type: application/sdp
Content-Base: rtsp://127.0.0.1:8080/test.sdp
Content-Length: 714
Cache-Control: no-cache
Cseq: 3

v=0
o=- 15983509726091924853 15983509726091924853 IN IP4 zhaozhili
s=Unnamed
i=N/A
c=IN IP4 239.255.1.1/255
t=0 0
a=tool:vlc 4.0.0-dev
a=recvonly
a=type:broadcast
a=charset:UTF-8
a=control:rtsp://127.0.0.1:8080/test.sdp
m=audio 1234 RTP/AVP 96
b=RR:0
a=rtpmap:96 mpeg4-generic/48000/6
a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=11b0; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;
a=control:rtsp://127.0.0.1:8080/test.sdp/trackID=0
m=video 1236 RTP/AVP 96
b=RR:0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=4d4029;sprop-parameter-sets=J01AKakYDwBE/LgDUBAQG2wrXvfAQA==,KN4JyA==;
a=control:rtsp://127.0.0.1:8080/test.sdp/trackID=1
SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=0 RTSP/1.0
CSeq: 4
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP;multicast;port=1234-1235

RTSP/1.0 461 Client error
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:57 GMT
Content-Length: 0
Cache-Control: no-cache
Cseq: 4

SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=0 RTSP/1.0
CSeq: 5
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP/TCP;unicast;interleaved=0-1

RTSP/1.0 461 Client error
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:57 GMT
Content-Length: 0
Cache-Control: no-cache
Cseq: 5

SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=1 RTSP/1.0
CSeq: 6
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP;multicast;port=1236-1237

RTSP/1.0 461 Client error
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:57 GMT
Content-Length: 0
Cache-Control: no-cache
Cseq: 6

SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=1 RTSP/1.0
CSeq: 7
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP/TCP;unicast;interleaved=2-3

RTSP/1.0 461 Client error
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:57 GMT
Content-Length: 0
Cache-Control: no-cache
Cseq: 7

OPTIONS rtsp://localhost:8080/test.sdp RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Content-Length: 0
Cseq: 2
Public: DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE,GET_PARAMETER

DESCRIBE rtsp://localhost:8080/test.sdp RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Accept: application/sdp

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:57 GMT
Content-Type: application/sdp
Content-Base: rtsp://127.0.0.1:8080/test.sdp
Content-Length: 714
Cache-Control: no-cache
Cseq: 3

v=0
o=- 15983509726091924853 15983509726091924853 IN IP4 zhaozhili
s=Unnamed
i=N/A
c=IN IP4 239.255.1.1/255
t=0 0
a=tool:vlc 4.0.0-dev
a=recvonly
a=type:broadcast
a=charset:UTF-8
a=control:rtsp://127.0.0.1:8080/test.sdp
m=audio 1234 RTP/AVP 96
b=RR:0
a=rtpmap:96 mpeg4-generic/48000/6
a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=11b0; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;
a=control:rtsp://127.0.0.1:8080/test.sdp/trackID=0
m=video 1236 RTP/AVP 96
b=RR:0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=4d4029;sprop-parameter-sets=J01AKakYDwBE/LgDUBAQG2wrXvfAQA==,KN4JyA==;
a=control:rtsp://127.0.0.1:8080/test.sdp/trackID=1
SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=0 RTSP/1.0
CSeq: 4
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP;multicast;port=1234-1235

RTSP/1.0 461 Client error
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:57 GMT
Content-Length: 0
Cache-Control: no-cache
Cseq: 4

SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=0 RTSP/1.0
CSeq: 5
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP/TCP;unicast;interleaved=0-1

RTSP/1.0 461 Client error
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:57 GMT
Content-Length: 0
Cache-Control: no-cache
Cseq: 5

SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=1 RTSP/1.0
CSeq: 6
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP;multicast;port=1236-1237

RTSP/1.0 461 Client error
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:57 GMT
Content-Length: 0
Cache-Control: no-cache
Cseq: 6

SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=1 RTSP/1.0
CSeq: 7
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP/TCP;unicast;interleaved=2-3

RTSP/1.0 461 Client error
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:57 GMT
Content-Length: 0
Cache-Control: no-cache
Cseq: 7

-------------- next part --------------
OPTIONS rtsp://localhost:8080/test.sdp RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Content-Length: 0
Cseq: 2
Public: DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE,GET_PARAMETER

DESCRIBE rtsp://localhost:8080/test.sdp RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Accept: application/sdp

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:05 GMT
Content-Type: application/sdp
Content-Base: rtsp://127.0.0.1:8080/test.sdp
Content-Length: 714
Cache-Control: no-cache
Cseq: 3

v=0
o=- 15983509502703916485 15983509502703916485 IN IP4 zhaozhili
s=Unnamed
i=N/A
c=IN IP4 239.255.1.1/255
t=0 0
a=tool:vlc 4.0.0-dev
a=recvonly
a=type:broadcast
a=charset:UTF-8
a=control:rtsp://127.0.0.1:8080/test.sdp
m=video 1234 RTP/AVP 96
b=RR:0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=4d4029;sprop-parameter-sets=J01AKakYDwBE/LgDUBAQG2wrXvfAQA==,KN4JyA==;
a=control:rtsp://127.0.0.1:8080/test.sdp/trackID=0
m=audio 1236 RTP/AVP 96
b=RR:0
a=rtpmap:96 mpeg4-generic/48000/6
a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=11b0; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;
a=control:rtsp://127.0.0.1:8080/test.sdp/trackID=1
SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=0 RTSP/1.0
CSeq: 4
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP;multicast;port=1234-1235

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:05 GMT
Transport: RTP/AVP/UDP;destination=239.255.1.1;port=1234-1235;ttl=1;mode=play
Session: 534646116;timeout=60
Content-Length: 0
Cache-Control: no-cache
Cseq: 4

SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=1 RTSP/1.0
CSeq: 5
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP;multicast;port=1236-1237
Session: 534646116

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:05 GMT
Transport: RTP/AVP/UDP;destination=239.255.1.1;port=1236-1237;ttl=1;mode=play
Session: 534646116;timeout=60
Content-Length: 0
Cache-Control: no-cache
Cseq: 5

PLAY rtsp://127.0.0.1:8080/test.sdp RTSP/1.0
CSeq: 6
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Session: 534646116
Range: npt=0.000-

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:05 GMT
Session: 534646116;timeout=60
Content-Length: 0
Cache-Control: no-cache
Cseq: 6

GET_PARAMETER rtsp://127.0.0.1:8080/test.sdp RTSP/1.0
CSeq: 7
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Session: 534646116

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:05 GMT
Session: 534646116;timeout=60
Content-Length: 0
Cache-Control: no-cache
Cseq: 7

TEARDOWN rtsp://127.0.0.1:8080/test.sdp RTSP/1.0
CSeq: 8
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Session: 534646116

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:10 GMT
Session: 534646116;timeout=60
Content-Length: 0
Cache-Control: no-cache
Cseq: 8

OPTIONS rtsp://localhost:8080/test.sdp RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Content-Length: 0
Cseq: 2
Public: DESCRIBE,SETUP,TEARDOWN,PLAY,PAUSE,GET_PARAMETER

DESCRIBE rtsp://localhost:8080/test.sdp RTSP/1.0
CSeq: 3
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Accept: application/sdp

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:05 GMT
Content-Type: application/sdp
Content-Base: rtsp://127.0.0.1:8080/test.sdp
Content-Length: 714
Cache-Control: no-cache
Cseq: 3

v=0
o=- 15983509502703916485 15983509502703916485 IN IP4 zhaozhili
s=Unnamed
i=N/A
c=IN IP4 239.255.1.1/255
t=0 0
a=tool:vlc 4.0.0-dev
a=recvonly
a=type:broadcast
a=charset:UTF-8
a=control:rtsp://127.0.0.1:8080/test.sdp
m=video 1234 RTP/AVP 96
b=RR:0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=4d4029;sprop-parameter-sets=J01AKakYDwBE/LgDUBAQG2wrXvfAQA==,KN4JyA==;
a=control:rtsp://127.0.0.1:8080/test.sdp/trackID=0
m=audio 1236 RTP/AVP 96
b=RR:0
a=rtpmap:96 mpeg4-generic/48000/6
a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=11b0; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;
a=control:rtsp://127.0.0.1:8080/test.sdp/trackID=1
SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=0 RTSP/1.0
CSeq: 4
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP;multicast;port=1234-1235

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:05 GMT
Transport: RTP/AVP/UDP;destination=239.255.1.1;port=1234-1235;ttl=1;mode=play
Session: 534646116;timeout=60
Content-Length: 0
Cache-Control: no-cache
Cseq: 4

SETUP rtsp://127.0.0.1:8080/test.sdp/trackID=1 RTSP/1.0
CSeq: 5
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Transport: RTP/AVP;multicast;port=1236-1237
Session: 534646116

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:05 GMT
Transport: RTP/AVP/UDP;destination=239.255.1.1;port=1236-1237;ttl=1;mode=play
Session: 534646116;timeout=60
Content-Length: 0
Cache-Control: no-cache
Cseq: 5

PLAY rtsp://127.0.0.1:8080/test.sdp RTSP/1.0
CSeq: 6
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Session: 534646116
Range: npt=0.000-

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:05 GMT
Session: 534646116;timeout=60
Content-Length: 0
Cache-Control: no-cache
Cseq: 6

GET_PARAMETER rtsp://127.0.0.1:8080/test.sdp RTSP/1.0
CSeq: 7
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Session: 534646116

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:05 GMT
Session: 534646116;timeout=60
Content-Length: 0
Cache-Control: no-cache
Cseq: 7

TEARDOWN rtsp://127.0.0.1:8080/test.sdp RTSP/1.0
CSeq: 8
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)
Session: 534646116

RTSP/1.0 200 OK
Server: VLC/4.0.0-dev
Date: Tue, 05 Dec 2017 08:20:10 GMT
Session: 534646116;timeout=60
Content-Length: 0
Cache-Control: no-cache
Cseq: 8



More information about the vlc-devel mailing list