How to connect Xiaomi IP camera to DVR: the complete guide

The integration of Xiaomiโ€™s devices into existing security systems is often a question for users who are used to proprietary cloud solutions. The main difficulty is that the standard protocol of camera operation through the Mi Home application is closed and is not intended for direct transmission of the video stream to third-party DVRs (NVR). However, using standard data transmission protocols, such as RTSP or ONVIF, You can successfully translate the image from IP-cameras on any manufacturer's recording device.

The setup process requires understanding network interactions and properly configuring the cameraโ€™s software. Youโ€™ll need not only physical access to the device, but also installing specialized software to activate hidden broadcast functions. Xiaomi and sub-brands like Yi Technology use different methods to activate these protocols, so you wonโ€™t find a universal โ€œonโ€ button in the standard interface.

In this guide, we will go into detail the algorithm of actions necessary to turn a smart camera into a full-fledged element of a video surveillance system. RTSP-Stream, security password settings, and proper logging, and by following these steps, you can organize a local video archive recording without depending on cloud services.

Preparation of equipment and network infrastructure

Before you start software setup, you need to ensure that the right physical environment for the devices to work. The CCTV camera and the DVR must be on the same LAN. This means that both devices must be connected to the same router, whether via Wi-Fi or an Ethernet cable. Using guest networks or isolated VLANs without proper routing will result in the recorder simply โ€œdoing not seeโ€ the camera.

The critical point is the assignment of static IP-Camera addresses. Dynamic addressing (DHCP) This can lead to a situation where, after restarting the router, the camera will receive a new address, and the DVR will lose communication with it. To avoid recording breaks, you need to reserve the address in the router settings or prescribe a static address. IP directly in the camera network parameters, if such an opportunity is provided.

โš ๏ธ Warning: Make sure your camera model technically supports the protocol ONVIF or RTSP. Budget models that run exclusively through the Zigbee gateway (hub) or Bluetooth do not have their own IP-addresses and cannot be connected to the video recorder directly.

You will need a computer or smartphone with access to the routerโ€™s web interface to check the addressing, and make sure the camera firmware version is up to date, as older versions of the software may lack the necessary network services or vulnerabilities that block third-party connectivity.

๐Ÿ“Š What type of connection do you plan to use?
Wi-Fi (wireless)
Ethernet (cable)
PoE (Power via cable)
Through USB-whistle

Activation of RTSP protocol on Xiaomi and Yi cameras

The standard firmware of most Xiaomi cameras does not have an open interface to enable RTSP. To activate the stream, it often requires the use of third-party software that is embedded in the camera through a temporary connection to a PC or through the installation of modified files on a memory card. One of the most popular solutions is the utility mi-rtsp-server or similar scripts available on the GitHub platform.

The activation process is usually like this: you download an executable file for your model, write it to a microSD card and paste it into the camera. Once turned on, the device reads the script and applies changes to the network configuration. It is important to accurately determine the model of the processor (SoC) on which your camera is running, since binary files for JZ4775 will not be suitable for MSXO3.

If youโ€™re not ready to do the flashing, check the settings in the official app. In some regions and for some models (especially the Xiaomi Outdoor Camera series), the ONVIF feature may be built-in, but hidden. Try changing the region in the Mi Home app to China or Europe, sometimes this will unlock additional menu items in the Camera Settings section.

List of popular utilities for activating RTSP
The JZ4775 camera processor often uses mi-rtsp-server scripts. Newer HiSilicon-based cameras may require telnet access and manual editing of configuration files. Remember that software modifications can lead to loss of warranty.

Once activated successfully, you should hear a distinctive beep or see the LED status change, which indicates that the broadcast service is running, and now the camera is ready to stream video on request, but for security, access to it is still protected.

Setting up passwords and ONVIF accounts

ONVIF requires authorization. Even if the RTSP stream is running, the DVR will not be able to access the video without the correct credentials. By default, many Xiaomi cameras have a login for ONVIF that is often fixed โ€” usually admin. However, the password must be manually set.

There are two ways to set a password, the first is through the camera's web interface, if it's available over the Internet. IP-The second, more common in the Xiaomi ecosystem, is through a hidden menu in the app or a special command in the console if you get root access. MAC-the device address and it can be found in the activation script documentation.

ParameterDefault valueRecommended valueWhere to change
Login (User)adminadminUnchangeable in most models
Port Port RTSP554554Configuration file
Port ONVIF80 / 808080Network settings
The flow/ch0_0.h264/ch0_0.h264Depends on the model.

Think of a complex password that consists of letters and numbers and write it down. Unlike cloud services, where account recovery is possible via email, access to the local ONVIF stream without a password will not be possible to restore without resetting the camera to factory settings and re-activating the RTSP.

๐Ÿ’ก

Use a password generator to create a complex combination of characters. Write the password in a safe place, as the camera does not store it in recoverable form in the cloud.

Instructions for adding a camera to the DVR

Once the camera is ready, the network is set up and the passwords are set, we move to the DVR configuration. The interface may vary depending on the brand (Hikvision, Dahua, HiWatch), but the logic is the same. You need to go to the camera control menu, usually the Camera section. โ†’ IP-camera.

Press the Add or Search button, and if the camera is on the same subnet, the recorder can find it automatically using the protocol. ONVIF. However, for stable operation, it is better to add the device manually, selecting the option "Custom" or "Other". IP-address enter static IP, which you have attached to the camera before.

The key is choosing a protocol. From the manufacturer list, select ONVIF. If there is no such option, select RTSP and manually enter the stream URL. The standard format for the stream address is as follows:

rtsp://admin:YOUR PASSON@192.168.1.100:554/ch0_0.h264

Where 192.168.1.100 โ€” it IP-And you can see the path to the flow at the end of the line, and you can see that the main stream is of high quality. /ch0_0.h264 or /h264_stream, a for substream (low quality) โ€” /ch0_1.h264. The exact syntax depends on the camera processor model.

โ˜‘๏ธ Checklist of connection

Done: 0 / 5

Solution: Camera is not connected or no sound

One of the most common problems is the error "Incorrect login/password" or "Disavowal of access", even when you are sure that the data entered is correct. This is often associated with time desynchronization. ONVIF requires that the time on the camera and on the DVR coincide with an accuracy of several minutes. If the camera is 2020 and on the recorder 2026, the connection will be blocked.

To solve this problem, go to the time settings on the DVR and turn on synchronization through NTP-Then, find the time setting in the camera menu (via the web interface or app) and sync it too. After restarting both devices, the problem usually disappears.

โš ๏ธ Note: If the video stream is going but there is no sound, check the audio codec. G.711, Xiaomi cameras can encode sound into AAC. You will need to change the audio settings in the configuration RTSP-server on the camera or enable transcoding on the registrar if it supports this function.

Another reason for the instability may be a lack of channel bandwidth. If you connect a camera in high resolution (2K or 4K) over Wi-Fi, the stream may be interrupted. Try lowering the bitrate in the camera settings or switching the recorder to receiving a substream for continuous monitoring, recording the main stream only on motion detection.

๐Ÿ’ก

Time synchronization (NTP) between the camera and the recorder is a critical step for successful ONVIF authorization.

Optimization of recording and storage of archives

Once successfully connected, it is important to adjust the recording settings to make efficient use of disk space. High-resolution permanent recording will quickly fill the hard drive. It is recommended to configure the recording by motion detection or schedule (for example, only at night).

For Xiaomi street cameras that are connected via RTSP, it is better to use the detection of the recorder itself (video stream analysis), since the smart functions of the camera itself (human recognition) through the ONVIF protocol are often not transmitted to the recording device.

Check your hard drive regularly. Security cameras put a high strain on your disk system because of constant recording. Use Surveillance disks (such as WD Purple or Seagate SkyHawk) that are designed to run 24/7. Conventional computer drives can quickly fail in this mode.

Can you connect Xiaomi camera to the registrar without activating RTSP?
Officially, no. Xiaomi cameras don't support RTSP out of the box in global firmware. However, some users find older versions of firmware or use specific hacks through ADB, but this is unstable. RTSP activation is mandatory for reliable operation.
What is the maximum bitrate of a standard RTSP stream?
Bitrate depends on the camera model and processor. Usually the main stream is from 2048 kbit / s to 6144 kbit / s for 2K/4K models. Exceeding the limits of the camera processor when setting the maximum quality can lead to a drop in FPS.
Does two-way audio communication work through ONVIF?
In most cases, no. ONVIF in Xiaomi cameras often only supports one-way audio transmission (camera โ†’ recorder). To implement the โ€œspeakโ€ function, it requires support for specific extensions that rarely work on third-party recorders.
Will the settings reset RTSP activation when the camera is reset?
Yes, a full reset of the camera (holding the Reset button for more than 10 seconds) will return the device to the factory settings. RTSP-server and set passwords as modified system files will be overwritten by the original.