How to Connect to Dahua Camera Remotely Using Python and OpenCV?

angygingy

n3wb
Apr 2, 2025
1
0
Argentina
Hello, community!

I'm working on a computer vision project using OpenCV (Python) and need to connect to my Dahua cameras.

Locally, I successfully accessed the camera stream via RTSP using my username, password, and IP address. I can also view the stream through the P2P QR code using an Android app.

However, I need to connect remotely using Python and OpenCV, but I haven't had any success.
Over the past few days, I've tried multiple solutions without success:
  • I attempted to use the Dahua Linux64 SDK but encountered connection errors.
  • I also tried dh-p2p (GitHub link below), and while everything appeared to run fine, I received a connection timeout error when attempting to access the RTSP stream.
    dh-p2p GitHub Repository
  • I got connection timeout errors with http://<ip>/cgi-bin/snapshot.cgi?0 and other api calls
Has anyone successfully connected to a Dahua camera stream remotely? If so, how did you do it?
Any advice or alternative solutions would be greatly appreciated!
 
Try FFmpeg. You can connect to the RTSP stream directly using FFmpeg.