How to connect Xiaomi camera to DVR: a step-by-step guide

Integrating smart home devices into a single security ecosystem is a logical step for any Xiaomi appliance owner. IP-camera and central video recorder (NVR) Standard cloud services often require a monthly fee, whereas local recording to a DVR hard drive solves the problem of subscription forever.

However, the process of synchronizing Mi Home cameras with third-party recorders is not always β€œplug-and-play”; there are technical nuances associated with data protocols and network settings, and in this article we will discuss in detail how to overcome the limitations of the ecosystem and set up a stable stream of video.

You have to deal with network addresses, ports and specific access passwords. Despite the apparent complexity, the right sequence of actions will allow you to get a professional video surveillance system without unnecessary costs. Readiness of equipment and a basic understanding of how the local network works will be your main tools in this process.

Technical requirements and compatibility of devices

Before you start setting up, you need to make sure your hardware supports the necessary video streaming protocols. The main standard to focus on is ONVIF and RTSP. Xiaomi cameras, especially the global versions, often have limited functionality in this regard out of the box, requiring additional manipulations to activate streaming.

It's important to understand the difference between models: Cameras that operate exclusively through a cloud gateway without a direct line. IP-Addressing in the local network, connect to a third-party NVR You'll need models that support local protocol or devices that have been modified (which may be warranty-free), and make sure your DVR supports adding devices over protocol. ONVIF.

The stability of the entire system depends on the quality of the network equipment. Using Wi-Fi connections for constant high-resolution streams can lead to desynchronization and loss of staff. For critical surveillance areas, it is preferable to use a wired Ethernet connection if the camera design allows it, or to ensure a powerful access point.

πŸ“Š What type of connection do you plan to use?
Wi-Fi 2.4 GHz
Wi-Fi 5 GHz
Ethernet wired
Through the Mesh system.

Pay attention to firmware versions. Sometimes manufacturers release updates that close vulnerabilities used to activate them. RTSP-stream, or conversely, add support for new standards. Check the relevance of the software on both the camera and the DVR before you start work.

Preparation of network infrastructure

The foundation of successful integration is the right setup of the LAN, where all devices -- the camera, the DVR and the router -- must be on the same subnet. IP-The address must have the same mask and initial numbers, for example, 192.168.1.X. If devices see each other, half the problem is solved.

A critical step is to assign a static camera. IP-Dynamic addressing (DHCP) It's convenient for regular users, but it's bad for security. If the router reboots and gives the camera a new address, the DVR will lose contact with the video source, and the recording will be interrupted.

To adjust the static IP You'll need to log into the router interface. DHCP-server or address reservation (Address Reservation). MAC-address of your camera with selected IP-This action can be performed through the router's web interface by going to the address indicated on the device sticker.

πŸ’‘

Use it. IP-addresses from the range reserved for static devices (e.g, 192.168.1.200-250), Avoid conflicts with the main customers of the network.

Check port availability. Standard port for HTTP-The camera control is often 80, and RTSP β€” 554 Make sure that the router firewall or antivirus on the computer does not block these ports within the LAN. Open ports are necessary for the correct handshake between the registrar and the camera.

Activation of RTSP protocol and obtaining a password

The most difficult step for many Xiaomi models is to gain access to the video stream. Cameras running in the Mi Home ecosystem encrypt the stream to be transmitted to the cloud. To broadcast it to the DVR, you need to β€œpull” the stream out through the RTSP protocol. For some models (for example, Yi or older versions of Mi), this is done through a special application.

The process often requires the use of third-party software or scripts that send a special request to the camera. RTSP-This password has nothing to do with a Mi or Wi-Fi account password. Without this key, the DVR won't be able to log in and retrieve the image.

Where to find an RTSP password?
Passwords are often generated in a generator application (e.g., for Yi Home cameras) or displayed in logs when using modified firmware. Look for a line that starts with "rtsp://".

Once you get your password, write it down. You'll need it when you add the camera to the DVR menu. The password or encryption key field is exactly the same code. If you reset the camera to the factory settings, you'll probably have to repeat the password procedure again.

⚠️ Attention: Use of informal activation methods RTSP This can cause the camera to run unstable or breach warranty conditions.Make sure you use proven methods for your particular model.

Some modern Xiaomi models with HomeKit or ONVIF standard support out of the box let you turn RTSP right into the Mi Home app menu. Check the camera settings under Storage Settings or Additional. If there's a switch on "Enable RTSP," you're lucky - activation will take a couple of seconds.

Step-by-step setting up the video recorder (NVR)

Now that the camera is ready to stream, we go to the DVR. Interfaces from different manufacturers (Hikvision, Dahua, HiWatch) may differ, but the logic is the same. You need to find the camera control section, often called Camera, IP Channel, or Add Device.

Select Custom Add mode. Automatic search (ONVIF Search) may not work if the camera is on a different subnet or requires specific settings. IP-The camera address in the appropriate field. ONVIF or RTSP, depending on what supports your NVR.

β˜‘οΈ Channel setting NVR

Done: 0 / 5

The username field for Xiaomi cameras often uses the name admin, but this is not a universal rule. Sometimes you need to specify the username you set when you originally set up the camera. The password, as mentioned earlier, is taken from activating RTSP. After entering the data, click Save or OK.

If the channel status is changed to Connected or the green light bulb is on, the DVR has successfully received the video stream. Now you can configure the recording parameters: continuous, on motion or on schedule.

Different Xiaomi camera models may require different settings to successfully connect. Below is a summary table with typical settings for common devices. Note that firmware may be updated and data may change.

Camera modelProtocolPort Port RTSPLogin by defaultFeatures
Mi Home Security 360RTSP / ONVIF554adminRequires activation through the application
Xiaomi DafangRTSP554rootOften requires alternative firmware
Yi Home CameraRTSP554adminWe need a password generator.
Mi Outdoor CamONVIF2020adminSupport SD-card

Use this data as a starting point. If standard ports don't work, try scanning your device with a network port scanner to find an open video streaming service. Sometimes manufacturers change standard ports for security reasons.

The Features column highlights critical points, such as for some models, having a microSD card is a prerequisite for buffering and activating network functions, and make sure the card is formatted and functional.

Diagnostics and solution of common problems

Even if you follow all the instructions, there can be problems, the most common of which is the "Black Screen" when you're connected, which means that the DVR has connected to the camera, but can't decode the video stream, and the reason is often codec incompatibility. The camera can broadcast to H.265, and the recorder can only understand H.264.

To solve this problem, log into the camera’s web interface (by entering its IP in the browser) and find the video settings. Switch the codec to a more compatible H.264 and reduce bitrate. Also try to lower the stream resolution for the sub-stream, which is often used for previews.

πŸ’‘

H.265 and H.264 codecs are incompatible, causing 80% of black screen problems on older DVRs.

Another problem is periodic communication breakdowns, which can be caused by a power shortage, if the camera is connected through a long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long. USB-cable, voltage may be lacking, especially at night when the IR lights are on. Use a high-quality cable and power supply with a margin of power.

⚠️ Warning: If the camera is constantly rebooting when you turn on night mode, replace the power supply with a more powerful one (for example, from 1A to 2A.

Check the DVR logs. They often contain the exact cause of the error, such as "Authentication Failed" or "Network Unreachable," which will help narrow down the search for the malfunction.

Optimizing the load on the network and storage

Connecting multiple high-resolution cameras puts a heavy strain on the local network. If the router is weak, it may not be able to handle data flows, leading to lag and packet loss. For systems with 4 or more cameras, it is recommended to use a managed switch with VLAN support or just a separate gigabit router.

The setup of the recording also affects performance. Recording in high resolution 24/7 will fill the disk quickly. Use smart functions: adjust the sensitivity of the motion detector so that the camera responds only to people or animals, ignoring swinging branches, which will save up to 70% of the disk space.

Regularly check the state of the DVR hard drive. Recording and overwriting video is a resource-intensive process. Timely replacement of the disc will prolong the life of the entire video storage system and ensure that the archive is safe at the right time.

What if the NVR can't see the camera on ONVIF?
Make sure that the time on the camera and the recorder is synchronized: a time difference of more than 5 minutes often blocks the connection over the ONVIF protocol due to security certificate errors.

Frequently Asked Questions (FAQ)

Can I connect a Xiaomi camera to a registrar without a router?
Yes, it's possible, but it requires direct configuration. You can connect the camera and the recorder via a network switch or directly by cable if the recorder has a second network port. IP-addresses and activations RTSP You'll still need a computer on the same network. NVR They will work autonomously.
Why Xiaomi camera doesn’t work with Hikvision/Dahua recorder
The most common problem is security protocol: New cameras require the inclusion of "Allow insecure methods" in the ONVIF settings of the registrar itself. Also check if the time on the devices coincides. Sometimes it helps to create a separate user for ONVIF in the settings of the camera other than the administrator.
How to find an RTSP link for my camera?
The format of the link usually looks like this: rtsp://username:password@ip_address:port/stream1. For cameras, Xiaomi username is often equal to admin, port β€” 554, stream1 β€” This is the name of the stream (often ch0_0.h264 The exact format of the path to the flow depends on the model and can be found in documentation or in specialized forums.
Will two-way audio communication work through the DVR?
Most of the time, no. RTSP is primarily designed to transmit video streaming and sometimes audio. Camera rotation control (PTZ) and audio communication often require proprietary manufacturer protocols that are not supported by third-party NVRs.