@@ -1175,6 +1175,9 @@ Set socket TCP I/O timeout in microseconds.
@item user_agent
Override User-Agent header. If not specified, it defaults to the
libavformat identifier string.
+
+@item ignore_rtcp
+Ignore rtcp packets in rtsp stream to avoid transcoding stuck. Default valule is 0.
@end table
When receiving data over UDP, the demuxer tries to reorder received packets
@@ -97,6 +97,7 @@ const AVOption ff_rtsp_options[] = {
{ "timeout", "set timeout (in microseconds) of socket TCP I/O operations", OFFSET(stimeout), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC },
COMMON_OPTS(),
{ "user_agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = LIBAVFORMAT_IDENT}, 0, 0, DEC },
+ { "ignore_rtcp", "when the rtcp packet is received in the rtsp stream, it will be ignored", OFFSET(ignore_rtcp), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
{ NULL },
};
@@ -416,6 +416,11 @@ typedef struct RTSPState {
*/
char *user_agent;
+ /**
+ * ignore rtcp packet
+ */
+ int ignore_rtcp;
+
char default_lang[4];
int buffer_size;
int pkt_size;
@@ -817,6 +817,8 @@ redo:
}
goto redo;
found:
+ if (rt->ignore_rtcp && (id == 1 || id == 3 ))
+ goto redo;
*prtsp_st = rtsp_st;
return len;
}
From: Minlei Sun <sunml@epoint.com.cn> Regarding ignore_rtcp flag, it is turned off by default. When some devices (such as hikvision iSecure Center Platform v1.3.xxx) rtsp stream contains rtcp data packets (may be non-standard), there will be a freeze when the output is rtmp stream. So when igore_rtcp is enabled, this situation can be solved. --- doc/protocols.texi | 3 +++ libavformat/rtsp.c | 1 + libavformat/rtsp.h | 5 +++++ libavformat/rtspdec.c | 2 ++ 4 files changed, 11 insertions(+)