Skip to content

Commit

Permalink
✨ Helper: Added support for SRTP/RTSPS in is_valid_url function (Fixes
Browse files Browse the repository at this point in the history
 #410)

- ⚡️ 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.
  • Loading branch information
abhiTronix committed Jun 20, 2024
1 parent 0f620e6 commit 7a25a80
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vidgear/gears/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7a25a80

Please sign in to comment.