Integration IP-Xiaomi cameras in the video surveillance system NVR

Modern security systems are increasingly built on the basis of available IP-The Xiaomi ecosystem is leading the way in terms of price and quality, but the standard Mi Home app often limits users: The records are stored only in the cloud or on a local memory card, and direct access to the video stream for a third-party recorder is closed. ONVIF In the stock firmware of most Xiaomi cameras disabled by the manufacturer.

To fully work with NVR-The registrar needs to overcome software limitations, so you need to access advanced device settings, activate hidden data services, and properly configure network settings. This will allow you to stream video to any compatible recorder, providing continuous recording and centralized storage of the archive.

In this guide, we will discuss the technical nuances of connection, the necessary utilities to unlock functionality and step-by-step configuration algorithm. You will learn to bypass the manufacturer’s restrictions to create a reliable video surveillance system, where Xiaomi acts as a source of video signal and the recorder is a reliable data store.

Technical requirements and equipment preparation

Before proceeding with software configuration, you need to make sure the physical compatibility of the equipment. IP-Xiaomi cameras and yours NVR-The recorder must be on the same LAN, and that's a fundamental requirement that makes it impossible to transmit a video stream without it. Make sure that the router supports a lot of connected devices, because the video stream puts a lot of pressure on the channel.

The most important aspect is the camera firmware version. In recent updates, Xiaomi often closes vulnerabilities that were used to activate the ONVIF protocol. If you have a new model released in 2023-2026, standard methods may not work without first downgrad firmware or using specialized scripts. Older models, such as the Mi Home Security Camera 360Β° 1080p, are easier to configure.

You'll also need a computer with access to the LAN for the initial configuration, and you'll need network scanning tools on your PC, like Advanced IP Scanner or ONVIF Device Manager, to help you find the camera on the network, even if it's not visible to the registrar, and check the open ports.

⚠️ Attention: The process of activating hidden functions may lead to loss of warranty.All actions to change the software you perform at your own risk.

Check the list of equipment required before starting:

  • πŸ“· IP-Xiaomi camera (Mijia or Yi series models)
  • πŸ“Ό Network video recorder (NVR) protocol-enabled ONVIF
  • πŸ’» Computer or laptop to configure the network
  • πŸ”Œ Router free. LAN-port and Wi-Fi

Activation of the ONVIF protocol and obtaining a password

Standard procedure for connecting through QR-The code in the Mi Home app doesn't allow access to network protocols. To get the registrar to see the camera, you need to activate the service. ONVIF. On most models, this is done through a hidden developer menu or by linking the camera to a third-party application that supports this standard, such as mi-home-rtsp-server (for advanced users with a Linux server) or through temporary firmware flashing.

The most common and relatively safe method for home users is to use the Device Password function in the web interface if the model allows it, or activate via ADB (Android Debug Bridge) for Android cameras. Once the service is activated, the camera will start streaming on a standard port 80 or 8080, and port 554 (RTSP) will be reserved for the video stream.

A critical point is to set a password. By default, many Xiaomi devices either do not have an ONVIF password or match the Verification Code code found on the sticker at the bottom of the camera. However, for security reasons, it is strongly recommended to set a unique password through the settings menu, if such an option became available after activation.

Where can I find Verification Code?
The verification code is usually located on a factory sticker on the camera body or box, and it's labeled "Verification Code" or "Key." It's a 6-digit alphanumeric code that is often used as the default password to access the video stream.

Use the utility to check activation ONVIF Device Manager on PC. Enter IP-If you see a device tree and live video, it means that the protocol is working correctly.

  • πŸ”‘ Try standard passwords: blank, admin, or code with a sticker
  • 🌐 Make sure port 554 is open in the router's firewall
  • πŸ“‘ Check that the camera and PC are on the same subnet (e.g, 192.168.1.x)

Static adjustment IP-camera-address

Dynamic shift IP-address (DHCP) β€” If the router reboots, it can give the camera a new address, and the recorder will lose contact with it, stop writing archives. IP for each camera.

There are two ways to do this. One is through the router's settings. Go to the router control panel (usually 192.168.0.1 or 192.168.1.1), and find the section. DHCP Server or Address Reservation. find it in the list MAC-The address of your Xiaomi camera and write it down for the desired IP-Address that does not fall within the dynamic distribution range.

The second way is to configure inside the camera, if the firmware allows, but the router method is more reliable, because it ensures that the address will not change even when you reset the network settings on the camera itself. Once you assign the address, be sure to ping (command line ping command) to check the availability of the device.

πŸ’‘

Use it. IP-addresses from a range that the router does not automatically distribute (for example, if the router does not automatically distribute the address). DHCP It's going to be 100 to 200, it's going to be static 2 to 99 addresses, and it's going to prevent address conflicts on the network.

The table below shows an example of a correct addressing structure for a small system:

The deviceType of connectionIP-addressStatus
Router (Gateway)WAN/LAN192.168.1.1Active.
NVR RegistrarLAN (Cable)192.168.1.10Static
Xiaomi 1 cameraWi-Fi192.168.1.50Reserved.
Xiaomi 2 CameraWi-Fi192.168.1.51Reserved.

The process of adding a camera to the recorder

After successful activation ONVIF and fixation IP-The address can be moved to a direct connection to NVR. The interfaces of recorders from different brands (Hikvision, Dahua, HiWatch) may differ, but the logic of the action is the same. You need to go to the camera control menu, often called Camera Management or Add the device.

Select Manual Add. Automatic Plug & Play in the case of Xiaomi often doesn’t work, as cameras may not respond to specific requests from proprietary registrar protocols. In the β€œProtocol” or β€œType” field, be sure to select ONVIF. This is a key parameter that forces the registrar to communicate with the camera in a universal language.

Enter. IP-address you reserved earlier. port by default ONVIF 80, but some configurations require a port RTSP If the standard port doesn't work, try changing it in the camera settings via a web interface or Telnet.The login is most often admin, and the password is the one you set when you activated the service.

β˜‘οΈ Connection check

Done: 0 / 5

Once you save your settings, the device status should change to "Online." If the red indicator or the "Offline" status is on, check again the password and port availability. Sometimes you need to reboot the registrar to fully apply the network settings.

  • πŸ“Ή Select the correct stream: Main Stream (main) for recording and Sub Stream (substream) for previewing
  • πŸ”Š Check the audio channel: if the sound is not coming, make sure that the channel settings include audio transmission
  • πŸ“… Set up a recording schedule immediately after the image appears

Configuring video recording and coding parameters

Xiaomi cameras often use codecs H.265 or H.265+ Not all old loggers support this compression format. If you see a black screen or a message "Unsupported Stream" after you connect, go to the camera's encoding settings (via the web interface or the web interface). ONVIF-Manager and switch the video codec to H.264.

Resolution and frame rate also play a role. For security purposes indoors, 1920Γ—1080 at 15-20 fps is often enough. Set maximum values can overload the Wi-Fi channel and the recorder processor, frame skips during recording. The optimal bitrate for H.264 in FullHD is about 2048-4096 Kbps.

It is important to set the recording mode. In the recorder, select the "Motion Detection" or "Continuous" recording type. To save space on the hard drive, it is better to use the recording on the event, but with a sensitivity setting, so that the camera responds to real threats, rather than swinging curtains.

⚠️ Note: When using Wi-Fi connection, avoid setting a bitrate above 4096 Kbps. Unstable signal can cause audio and video to become out of sync or disconnect the connection.

Make sure to check the sound. The recorder channel settings must include the "Audio" or "Talk" option. If there is no audio, check to see if the microphone is turned off in the camera settings via the Mi Home app.

Solving Typical Connection Problems

One of the most common problems is time desynchronization, and the camera can show a time different from the time of the recorder, making it impossible to search for records from the archive. NTP-server in the camera menu (specify pool.ntp.org address) or forced time synchronization from the registrar, if such a function is available in the protocol ONVIF.

Another problem is Wi-Fi dead zones. Xiaomi cameras are often installed in corners or at heights where the signal is weak. Use the Wi-Fi Analyzer utility on your smartphone to check the signal level at the installation point. If the level is below -70 dBm, consider using a repeater Wi-Fi or switching to a wired connection (if the camera model has a LAN port or supports USB-Ethernet adapters).

Also, users face the problem of "double encoding." If the camera encodes the stream and the recorder tries to recode it again (Transcoding), the load on the system increases many times. In the registrar channel settings, make sure that the Main Stream mode is in place without transcoding to receive the stream directly from the camera matrix.

πŸ’‘

The stability of the video surveillance system based on Xiaomi depends on the quality of the Wi-Fi signal and the correct configuration of the static IP.

If the camera is permanently shut down, try turning off functions in the camera settings (via Mi Home) that the recorder doesn't need: cloud recording, push notifications to the phone, human smart detector operation, if the recorder is doing this, which will free up the camera processor's resources for stable RTSP stream transmission.

FAQ: Frequently Asked Questions

Can I connect a Xiaomi camera to a registrar without a router?
No, for work. IP-The camera and the registrar in the same network need a router (router) or a managed switch (switch) that will distribute the router. IP-Direct connection of the camera and the recorder by cable is possible only if the recorder has a built-in PoE switch with the function of the device. DHCP, But for Wi-Fi cameras, a router is a must.
What password should I use if the code from the sticker is not suitable?
If the standard verification code doesn’t work, you may have previously changed your password in the Mi Home app or when you first activate ONVIF. Try an admin password or a blank line. In extreme cases, you’ll need to completely reset the camera to factory settings (the Reset button on the case), after which the code from the sticker will become relevant again.
Why does the recorder see the camera but not the image?
The type of coding is probably not the same (H.265 against H.264) or incorrectly indicated port RTSP. Try adding the camera manually by selecting the Generic protocol or"RTSP", and enter the full flow path in the address field, for example: rtsp://admin:password@192.168.1.50:554/live/ch00_0.
How many Xiaomi cameras can be connected to a single registrar?
Theoretically, the number is limited only by the license of the registrar and network bandwidth. However, due to the peculiarities of implementing ONVIF in Xiaomi devices, stable operation is usually observed when connecting up to 4-8 cameras per NVR channel. For large systems, it is recommended to segment the network.