From 215fe9d1c643d83424727ec56de57d65c2cb1c14 Mon Sep 17 00:00:00 2001 From: Roger Hardiman Date: Mon, 13 Oct 2025 13:20:40 +0100 Subject: [PATCH] Fix AV1 when SDP reports RTP/AVPF (RTP with Feedback via RTCP for keyframe requests --- lib/RTSPClient.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/RTSPClient.ts b/lib/RTSPClient.ts index 9e92712..12f8a6e 100644 --- a/lib/RTSPClient.ts +++ b/lib/RTSPClient.ts @@ -23,6 +23,7 @@ import { import * as transform from "sdp-transform"; import RTPPacket from "./transports/RTPPacket"; const RTP_AVP = "RTP/AVP"; +const RTP_AVPF = "RTP/AVPF"; // Used by AV1. This is RTP with Feedback (via RTCP) to request Keyframes via RTCP const STATUS_OK = 200; const STATUS_UNAUTH = 401; @@ -267,7 +268,7 @@ export default class RTSPClient extends EventEmitter { ); } - // For now, only RTP/AVP is supported. (Some RTSPS servers use RTP/SAVP) + // For now, only RTP/AVP and RTP/AVPF are supported. (Some RTSPS servers use RTP/SAVP) const { media } = transform.parse(describeRes.mediaHeaders.join("\r\n")); // Loop over the Media Streams in the SDP looking for Video or Audio @@ -315,7 +316,7 @@ export default class RTSPClient extends EventEmitter { if ( mediaSource.type === "video" && - mediaSource.protocol === RTP_AVP && + (mediaSource.protocol === RTP_AVP || mediaSource.protocol === RTP_AVPF) && mediaSource.rtp[0].codec === "AV1" ) { this.emit("log", "AV1 Video Stream Found in SDP", "");