[FFmpeg-devel] [PATCH] libavformat/rtsp: fix rtsp multicasts

Marton Balint cus at passwd.hu
Mon Apr 20 00:43:22 EEST 2020



On Sun, 19 Apr 2020, Wolfgang Haupt wrote:

> On 19.04.20 14:53, Marton Balint wrote:
>>
>>
>> On Sun, 19 Apr 2020, Wolfgang Haupt wrote:
>>
>>> ping
>>>
>>> On 03.04.20 08:42, Wolfgang Haupt wrote:
>>>> Hey,
>>>>
>>>> is someone up to review this patch?
>>>>
>>>> It's an attempt to fix rtsp streams that use udp multicasts as the 
>>>> underlying
>>>> transmission protocol.
>>>> The idea was taken from live555 as the said stream worked in VLC.
>>>>
>>>> It still applies cleanly on current master.
>>>>
>>>>
>>>> Best Regards,
>>>> Wolfgang
>>>>
>>>> On 18.10.19 18:59, Wolfgang Haupt wrote:
>>>>> If an rtsp server offers a udp multicast
>>>>> address as response of a DESCRIBE command
>>>>> the rtsp client is expected to issue
>>>>> SETUP with "Transport: RTP/AVP/UDP;multicast".
>>>>> Some rtsp servers bail out otherwise.
>>>>> ---
>>>>>   libavformat/rtsp.c | 3 +++
>>>>>   1 file changed, 3 insertions(+)
>>>>>
>>>>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
>>>>> index 859defa592..3f0cbfc98b 100644
>>>>> --- a/libavformat/rtsp.c
>>>>> +++ b/libavformat/rtsp.c
>>>>> @@ -1913,6 +1913,9 @@ redirect:
>>>>>                   && (rt->rtsp_flags & RTSP_FLAG_PREFER_TCP))
>>>>>               lower_transport = RTSP_LOWER_TRANSPORT_TCP;
>>>>>   +        if (ff_is_multicast_address((struct 
>>>>> sockaddr*)&rt->rtsp_streams[rt->nb_rtsp_streams-1]->sdp_ip))
>>>>> +            lower_transport = RTSP_LOWER_TRANSPORT_UDP_MULTICAST;
>>>>> +
>>
>> Shouldn't this take into account lower_transport_mask? E.g. it should 
>> only prefer multicast if it is allowed in the mask?
>
> Can you explain what the lower_transport_mask is about?
> I cannot think of any case where you wouldn't want use udp multicast 
> when the rtsp server gives you a mutlicast-ip
> in response to a DESCRIBE request.

I am not familiar with the code, but it looks like it is used to control 
the allowed (tried) transport methods. The rtsp protocol has an 
rtsp_transport option, that is the source of the mask:
https://www.ffmpeg.org/ffmpeg-all.html#rtsp
If UDP multicast transport is disallowed because it is not in the mask 
then you should not set it as far as I see.

Regards,
Marton

>
>>
>> Thanks,
>> Marton
>>
>>>>>           err = ff_rtsp_make_setup_request(s, host, port, 
>>>>> lower_transport,
>>>>>                                    rt->server_type == 
>>>>> RTSP_SERVER_REAL ?
>>>>>                                        real_challenge : NULL);
>>>>
>>>>
>>>
>>> _______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel at ffmpeg.org
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>>> To unsubscribe, visit link above, or email
>>> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list