[FFmpeg-devel] [PATCH 1/1] libavformat/rtsp.c: Reply to GET_PARAMETER requests

Hayden Myers HMyers at skylinenet.net
Sat Jun 26 00:58:37 EEST 2021


Some encoders send GET_PARAMETER requests as a keep-alive mechanism.
If the client doesn't reply with an OK message, the encoder will close
the session.  This was encountered with the impath i5110 encoder, when
the RTSP Keep-Alive checkbox is enabled under streaming settings.
Alternatively one may set the X-No-Keepalive: 1 header, but this is more
of a workaround.  It's better practice to respond to an encoder's
keep-alive request, than disable the mechanism which may be manufacturer
specific.

Signed-off-by: Hayden Myers <hmyers at skylinenet.net>
---
 libavformat/rtsp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 9f509a229f..dc660368f0 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1259,7 +1259,9 @@ start:
         char base64buf[AV_BASE64_SIZE(sizeof(buf))];
         const char* ptr = buf;

-        if (!strcmp(reply->reason, "OPTIONS")) {
+        if (!strcmp(reply->reason, "OPTIONS") ||
+            !strcmp(reply->reason, "GET_PARAMETER")) {
+
             snprintf(buf, sizeof(buf), "RTSP/1.0 200 OK\r\n");
             if (reply->seq)
                 av_strlcatf(buf, sizeof(buf), "CSeq: %d\r\n", reply->seq);
--
2.20.1
Hayden Myers
Principal Software Engineer
t: (410) 590-2027
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image965675.png
Type: image/png
Size: 36556 bytes
Desc: image965675.png
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210625/5dabdb34/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image778576.png
Type: image/png
Size: 7149 bytes
Desc: image778576.png
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210625/5dabdb34/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image850278.png
Type: image/png
Size: 842 bytes
Desc: image850278.png
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210625/5dabdb34/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image867450.png
Type: image/png
Size: 817 bytes
Desc: image867450.png
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210625/5dabdb34/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image433548.png
Type: image/png
Size: 919 bytes
Desc: image433548.png
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210625/5dabdb34/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image760769.png
Type: image/png
Size: 653 bytes
Desc: image760769.png
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210625/5dabdb34/attachment-0005.png>


More information about the ffmpeg-devel mailing list