What is the best way to connect Dahua IP camera?

VegetaSan

n3wb
Apr 19, 2023
4
0
Ternopil
Hello there,
First of all, I want to apologize for stupid question, I don't have much experience with IP cameras

I have Java service (it runs on my server ) that can communicate with Imou IP cameras through their API.
It's pretty easy , my service just call url of open API - with methods names and can retrieve data from cameras
But now, I need to connect to my service Dahua cameras, at first I thought I could use same API as Imou, if I add this device to Imou app, but it's not working...
I even was able to retreive access token and snapshot for it, but when I trying to open url with snapshot, it says - NoSuchKey
So after that I decided to try Dahua API, but I see it don't have openAPI url like Imou's that I just can call to connect to my cameras
How can I do this? Is there a way to connect to Dahua cameras and communicate with them, if they just connected to wi-fi network?
Or it's necessarily to connect them to my server and olnly then call API with my owh hostname and port?

Thank you
 
To open the camera's embedded webGUI to configure the camera, open a browser to the camera's IP, enter the camera's username and password when prompted.

There's a Dahua API to SET or GET many camera functions or status, depending on the model. Generally the camera's username and password can be included in the URL at the beginning.

For instance, to retrieve a snapshot open a browser to:
Code:
http://Cam-username:Cam-password@Cam-IP/cgi-bin/snapshot.cgi?

To play a RTSP stream in VLC, open a network stream to:
Code:
rtsp:/Cam-username:Cam-password@Cam-IP:554/cam/realmonitor?channel=1&subtype=0

NOTE: Insure to place 2 "/" after "rtsp:", as the forum software will not allow me to post 2 consecutively here.

I have attached a PDF file of Dahua API v2.76 below.
 

Attachments

It should be noted that the info from @TonyR should work when you are on your local network. If you are expecting to access the same screens/info from a camera while out and about, you'll need to make sure you configure your cameras and network equipment to allow for it.
 
  • Like
Reactions: JDreaming and TonyR
It should be noted that the info from @TonyR should work when you are on your local network. If you are expecting to access the same screens/info from a camera while out and about, you'll need to make sure you configure your cameras and network equipment to allow for it.
How can I do this? I have Dahua config, but I don't see settings for this
 
At the least, you'll need to allow for 'outside in' access from the Internet to your LAN via your router. Best practice for this is via VPN:
 
  • Like
Reactions: JDreaming
At the least, you'll need to allow for 'outside in' access from the Internet to your LAN via your router. Best practice for this is via VPN:
Thank you for answer, it defiantly works now!
However I want to ask if there is way to avoid using VPN? For example connecting to network by using easy4ip. Is this possible? Because I see easy4ip option at my Dahua admin panel
 
@VegetaSan, better to use VPN to access your cameras when outside your LAN. Easy4IP is part of the Dahua P2P solution they offer for cloud access to Dahua cameras. Some members on the forum use P2P but most here recommend the use of a VPN. if you have an always-on computer, you can install ZeroTier or TailScale onto it to get access. Your router may have WireGuard or OpenVPN options to set up a VPN. Alternatively, you can setup a VPN on a Raspberry Pi.
 
@VegetaSan, better to use VPN to access your cameras when outside your LAN. Easy4IP is part of the Dahua P2P solution they offer for cloud access to Dahua cameras. Some members on the forum use P2P but most here recommend the use of a VPN. if you have an always-on computer, you can install ZeroTier or TailScale onto it to get access. Your router may have WireGuard or OpenVPN options to set up a VPN. Alternatively, you can setup a VPN on a Raspberry Pi.
I have an issue that involves the installation of cameras in public transport, which need to be connected to Wi-Fi transmitted from a 4G USB router. I am hoping to avoid using any additional equipment and achieve the same setup I had with Imou. With Imou, I simply installed the cameras, connected them to Wi-Fi, added them to the Imou app, and then utilized the Imou API. Although I was able to add Dahua cameras to the Imou app, I encountered difficulties in accessing their API. Therefore, a solution that utilizes P2P, allowing me to connect to the network using easy4ip and subsequently use Dahua's API, would be more suitable for my situation. Thank you for answer.