Open tegiac97 opened 2 years ago
The "@" symbol has special meaning in the RTSP protocol. While it is not impossible to use it in a password on an IP camera, a lot of RSTP clients have issues with passwords containing "@". To be specific, the "@" symbol is used to signal to the RSTP server the end of the username/password string, and the beginning of the RSTP URI.
IP camera password can use "@" symbol. I tried it on UNV, hikvision cameras. I can run stream with password with "@" character using vlc or ffmpeg.
Depends on the implementation of the RTSP client. I am fairly new this this particular library, But for my day job I work for a security integrator and have personally designed and deployed the some of the largest IP CCTV systems in the country... The most common way I have seen software implement the RTSP protocol is to embed the username and password directly into the URI. This is why I typically tell my clients not to use the @ symbol in a password for an IP camera. Yes, most cameras will let you do this, but it tends to cause a lot of problems when software tries to connect to the camera and pull an RTSP stream, because the @ symbol is used as a delimiter between the username/password, and the rest of the URI for the RTSP connection request.
I'll use an example of a Hanwha camera, that has a username of "admin" and a password of "password1", and an IP address of 192.168.1.100. (Hanwha's default IP)
rtsp://admin:password1@192.168.1.100/profile1/media.smp
If the password has an @ in it, and the RTSP client chooses this connection method, you end up confusing the RTSP server because it thinks the password ends before the @. This is not a bug, rather a limitation of the "Basic Authentication" method in the RTSP protocol. As you noted with VLC, it is possible for some software to work around this, using "Digest Authentication" where the client passes a hash of the username and password to the RTSP server after the initial connection. Some software like VLC support both authentication methods, but a disgusting amount of software out there, both commercial and open source, only support basic authentication for RTSP.
I'd bet money that this project only supports basic authentication.
Please note, I am just a user like your self, and am in no way affiliated with RtspClientSharp, and am looking at using this project to develop an AI analytic. That said, I am leaning towards using a different library now because this project looks like its abandoned.
Maybe you can change the @ to -> %40 which would be the same
Describe the bug If password has "@" character like
abc@123@
. Exception occurred inConnectAsync
. Invalid Username/Password I checked inNetworkCredential
, the correct password isabc@123@
Does anyone have any solution? THank you for helping! This is my src code.