[FFmpeg-trac] #9107(avformat:reopened): ffmpeg can't use RTSP/TCP but OpenRTSP does
FFmpeg
trac at avcodec.org
Mon Feb 22 12:59:03 EET 2021
#9107: ffmpeg can't use RTSP/TCP but OpenRTSP does
------------------------------------+------------------------------------
Reporter: aflopes7 | Owner:
Type: defect | Status: reopened
Priority: normal | Component: avformat
Version: git-master | Resolution:
Keywords: rtsp, tcp | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+------------------------------------
Changes (by aflopes7):
* status: closed => reopened
* resolution: invalid =>
Comment:
Well I understand your point more or less.
I openned this https://stackoverflow.com/q/66280861/1207193 on SO. I
managed to solve it by modifying `ffmpeg/libavformat/rtsp.c` replacing:
{{{
if (!av_strcasecmp(lower_transport, "TCP"))
th->lower_transport = RTSP_LOWER_TRANSPORT_TCP;
else
th->lower_transport = RTSP_LOWER_TRANSPORT_UDP;
}}}
by
{{{
if (!av_strcasecmp(lower_transport, "TCP") ||
!av_strcasecmp(lower_transport, ""))
th->lower_transport = RTSP_LOWER_TRANSPORT_TCP;
else
th->lower_transport = RTSP_LOWER_TRANSPORT_UDP;
}}}
I insertd `|| !av_strcasecmp(lower_transport, "")` in the code. Making it
assume that the transport is RTSP_LOWER_TRANSPORT_TCP when lower_transport
is ommited. This works for me but I wouldn't suggest it as a fix.
I think would be nice make FFMPEG more forgiving to RTSP servers (not very
RTSP compliant). Altough I don't know if it would be a accepted behavior
for FFMPEG team due its current views or approachs.
In that scenario a better solution would be consider the case of a missing
lower transport on a rtsp server answer. Then compare with the client-sent
request to define whether the lower transport was ommitted. And try to
connect with it.
I hope I did not take much of your time guys.
Thank you very much!
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9107#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list