1.37.4x rtsp passwords with special chars broken
Posted: Thu Aug 24, 2023 5:30 am
I just upgraded from 1.37.28 to 1.37.42, and my rtsp streams broke. (Also confirmed the same behavior in 1.37.40) The tldr is that it seems passwords are being handled differently, and that special characters aren't being URI escaped correctly (my guess.) Changing the passwords on my cameras to eliminate the '!' (bang) character, and then updating the pw in ZM brought my streams back.
More info:
I access my cams through ffmpeg with rtsp://username:password@IPADDRESS:554/cam...
Entering this URL in ZM results in the username and pwd being intelligently removed from the URL and placed in the appropriate un and pw fields. So far, so good. But, the streams no longer work as they used to, and the log shows 401 Unauthorized errors being reported by ffmpeg.
This works on the command line, though:
ffmpeg -i "rtsp://admin:amcrpwd22%21@192.168.10.33:554/cam/realmonitor?channel=1&subtype=0&authbasic=64" -c:v copy -c:a copy blah.mp4
I mentioned above that my password had a '!' in it. You'll see that the above ffmpeg command URL has that escaped as %21, and that is what I enter into ZM:
Source:
Source Path: rtsp://192.168.10.33:554/cam/realmonitor?channel=1&subtype=0&authbasic=64
Username: admin
Password: Amcrpwd22%21
So, my suspicion is that the escaped '!', which results in %21 might be getting double-escaped (sort of) as it gets passed to ffmpeg, resulting in the '%' also being escaped like so: Amcrpwd22%2521
But, that's just a hunch. Regardless of the cause, changing my passwords to eliminate the '!' resulted in working streams.
More info:
I access my cams through ffmpeg with rtsp://username:password@IPADDRESS:554/cam...
Entering this URL in ZM results in the username and pwd being intelligently removed from the URL and placed in the appropriate un and pw fields. So far, so good. But, the streams no longer work as they used to, and the log shows 401 Unauthorized errors being reported by ffmpeg.
This works on the command line, though:
ffmpeg -i "rtsp://admin:amcrpwd22%21@192.168.10.33:554/cam/realmonitor?channel=1&subtype=0&authbasic=64" -c:v copy -c:a copy blah.mp4
I mentioned above that my password had a '!' in it. You'll see that the above ffmpeg command URL has that escaped as %21, and that is what I enter into ZM:
Source:
Source Path: rtsp://192.168.10.33:554/cam/realmonitor?channel=1&subtype=0&authbasic=64
Username: admin
Password: Amcrpwd22%21
So, my suspicion is that the escaped '!', which results in %21 might be getting double-escaped (sort of) as it gets passed to ffmpeg, resulting in the '%' also being escaped like so: Amcrpwd22%2521
But, that's just a hunch. Regardless of the cause, changing my passwords to eliminate the '!' resulted in working streams.