From 7a25a8031a189eb3967be2232e862b56f7981b06 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Thu, 20 Jun 2024 21:08:46 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Helper:=20Added=20support=20for=20S?= =?UTF-8?q?RTP/RTSPS=20in=20`is=5Fvalid=5Furl`=20function=20(Fixes=20#410)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ⚡️ Enhanced `is_valid_url` in `helper.py` to recognize and support both `rtsp` and `rtsps` protocols. (Suggested by @jonra1993) - 💬 SRTP/RTSPS extends RTSP/RTP to encrypt video and audio data using the same ciphers as HTTPS, typically AES with a 128-bit key length. --- vidgear/gears/helper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vidgear/gears/helper.py b/vidgear/gears/helper.py index a7ab5ba85..0535c9391 100755 --- a/vidgear/gears/helper.py +++ b/vidgear/gears/helper.py @@ -603,8 +603,11 @@ def is_valid_url(path, url=None, logging=False): protocols = check_output([path, "-hide_banner", "-protocols"]) splitted = [x.decode("utf-8").strip() for x in protocols.split(b"\n")] supported_protocols = splitted[splitted.index("Output:") + 1 : len(splitted) - 1] - # rtsp is a demuxer somehow - supported_protocols += ["rtsp"] if "rtsp" in get_supported_demuxers(path) else [] + # RTSP is a demuxer somehow + # support both RTSP and RTSPS(over SSL) + supported_protocols += ( + ["rtsp", "rtsps"] if "rtsp" in get_supported_demuxers(path) else [] + ) # Test and return result whether scheme is supported if extracted_scheme_url and extracted_scheme_url in supported_protocols: logging and logger.debug(