Fixing "Connection Refused" and "401 Unauthorized" in RTSP Streams
Comprehensive troubleshooting steps to resolve authentication failures, port blocks, and socket timeouts.
Need a live RTSP stream link right now to test this setup in VLC or OpenCV?
#1Step 1: Check Digest vs Basic Authentication
Many modern IP cameras (Hikvision, Dahua, Axis) disable Basic Authentication by default and require Digest Auth. Ensure your client library (e.g. FFmpeg, OpenCV) is compiled with libavformat capable of HTTP/RTSP Digest handshakes.
#2Step 2: Verify Port 554 Reachability
Test TCP socket connectivity from your terminal:
nc -zv 192.168.1.64 554Ready to test your live RTSP video stream?
Generate free authenticated RTSP links with unlimited bandwidth and inspect frame timestamps in seconds.
Related Tutorials & Setup Guides
View all 100+ guidesFixing MediaMTX "source not ready" and "timed out waiting for keyframe"
Step-by-step resolution for MediaMTX source timeout errors, publisher reconnection loops, and H.264 SPS/PPS parsing failures.
troubleshootingFixing Grey Screens, Smearing & Macroblocking in RTSP Streams
Learn why RTSP video turns grey or smears during motion, and how forcing TCP transport and adjusting I-frame intervals permanently resolves it.
troubleshootingFixing VLC Media Player RTSP Stream Stuttering and 1-Second Lag
Tutorial on eliminating video stuttering and 1000ms delay when streaming high-resolution RTSP camera feeds in VLC.