Network storage NAS Xiaomi cameras are the perfect combination for a long-term video surveillance system, but many users have difficulty keeping a record directly on the site. NAS, Instead of a standard cloud storage or microSD card, in this article we will explore all possible ways of integrating, from basic configuration via Mi Home to advanced methods using the use of the software. RTSP and ONVIF.
The main problem is that Xiaomi does not officially support recording to network storage in most budget camera models (for example, Mi Home Security Camera 360).Β° 1080p or Xiaomi Mi Camera 2K However, there are workarounds, and we'll go into them in detail. It's important to understand that the process depends on the camera model, the firmware and the type of camera. NAS (Synology, QNAP, TrueNAS or homemade solution based on Raspberry Pi).
If you are using a camera with support ONVIF (Xiaomi Mi Home Security Camera 2K It's a little bit simplistic, and the rest of us will need some extra software like Home Assistant, iSpy, or Blue Iris. We've covered all the scenarios, and you can pick the one that suits you.
1. Does Xiaomi cameras support recording on the NAS directly?
Xiaomiβs official position on the issue is mixed, with most of the low-end and mid-range cameras (Mi Home Camera) being used in the same way. 1080p, Mi Camera 2K, Xiaomi C300) originally designed for:
- π Cloud storage Mi Cloud (paid after 7 days)
- π Local recording on a microSD card (up to 128 GB)
- π₯οΈ Viewing in real time through the Mi Home app
However, there are exceptions:
- β Xiaomi Mi Home Security Camera 2K Pro (model) T8020XW) β supportive ONVIF and RTSP scaling-in.
- β Xiaomi C400 and C500 β have built-in support FTP and NAS latest updates.
- β All cameras with MiJia (e.g. Mijia 360)Β° 1080p) β Cloud or microSD only.
If your model is not supported, donβt despair: below we will look at alternative methods using third-party software. It is also worth checking the firmware version β sometimes the opportunity appears after an update. 2K support RTSP It only appeared in the firmware. 1.4.6_0043 newer.
Preparation NAS-camera-recording
Before setting up the camera, you need to prepare the network storage itself. NAS, But the steps are the same:
- Create a separate folder for records (for example, /video/xiaomi_cam). This will make it easier to manage files and configure access rights.
- Set up a limited user. Don't use an administrator account; create a separate user (e.g., create a separate user, camera_user) only accessed to this folder.
- Activate the required protocol: π SMB/CIFS β The easiest option for Windows and most NAS. π FTP β It is supported by some Xiaomi cameras (for example, the camera, C400). π NFS β More secure but difficult to set up.
Example of setting up a shared folder on Synology NAS:
- Open the control panel. β Shared folder.
- Create a new folder (for example, xiaomi_cam).
- In the access settings add the user camera_user recording-wise.
- Activate the protocol. SMB/AFP control panel β File service.
If Network Storage is not on the menu, your camera model does not support this feature, so move to the next section with alternative methods.
The camera is connected to the same network as the NAS|Nana NAS launched FTP-server (port 21 is open)|User on NAS recorder|The password does not contain Cyrillic characters.-->
4. Alternative methods of recording on NAS (noncompatible)
If your Xiaomi camera doesnβt support FTP or ONVIF, You'll have to use third-party software. Let's look at three proven options:
4.1.Use Home Assistant with Xiaomi Miio component
Home Assistant is an open smart home platform that lets you integrate Xiaomi cameras and save videos on your home. NAS It's through FFmpeg:
- Install Home Assistant on a separate device (Raspberry Pi, old PC, or even Docker on the device itself). NAS).
- Add Xiaomi Miio integration: configuration.yaml: xiaomi_miio: username:!secret miio_username password:!secret miio_password (Login/password from the Mi Home account tied to the camera.)
- Configure the recording using FFmpeg: camera: - platform: ffmpeg input:!secret camera_rtsp_url name: Xiaomi Cam extra_arguments: -pred 1 -q:v 2 (URL for RTSP You can get it through Mi Home or Mi Home Hack.)
- Set up an automatic recording on NAS through SMB or FTP with the File Editor Addon.
The advantage of this method is flexibility: you can adjust the recording by movement, schedule or continuously. The disadvantage is that it requires a separate device for the Home Assistant to work.
iSpy (Windows) Program
iSpy is a free video surveillance software that supports Xiaomi cameras via the RTSP or ONVIF. Instructions:
- Download and install iSpy from the official website.
- Add a new camera: Select IP Camera with Wizard. Enter. IP-Camera address (can be found in Mi Home) β Settings β General information. Specify the protocol ONVIF or RTSP (URL species rtsp://admin:password@IP:554/stream1).
NAS
- Go to the Settings β Recording.
- Select Network Drive and specify the path to the folder on NAS (for example, \\192.168.1.100\video\xiaomi_cam).
- Set up a schedule or a record by movement.
iSpy supports up to 4 cameras in the free version and does not require a powerful PC β enough laptop or mini PC on Intel NUC.
4.3 Blue Iris (Windows, paid)
Blue Iris β Professional Video Surveillance Solution with Support RTSP, ONVIF and direct recording NAS. Features:
- π₯ Support for up to 64 cameras in one license.
- π Facial and motion recognition (requires a powerful PC).
- π Live recording on NAS down SMB, FTP or iSCSI.
To set up:
- Install Blue Iris and add a camera through Add Camera β Find/Inspect (The program will find Xiaomi on the network).
- In the camera settings, specify RTSP-flow (example) URL for the Mi Camera 2K): rtsp://admin:[PASSWORD]@[IP]:554/stream1
- Set up storage: Go to Settings β Storage. Select the Network Path and point the way to the NAS (for example, \\NAS-IP\video\xiaomi_cam). Set up a recording schedule and archiving options.
Blue Iris is paid (around) $50), but offers maximum stability and functionality, suitable for systems with 5+ camera.
How to get RTSP-stream?
5. Storage optimization and problem solving
Video recording from the camera NAS It can fill up a disk quickly if you don't set up the archive correctly:
| Problem. | Decision | Tools |
|---|---|---|
| The disk fills up quickly. | Set up automatic deletion of old records (for example, only store the last 7 days). | Cron (on) NAS), Blue Iris, iSpy |
| Disc fragmentation | Use the Btrfs file system or ZFS (They're better at handling small files). | Synology DSM, TrueNAS |
| The camera loses its connection to NAS | Check network stability (use cable instead of Wi-Fi) and set up keepalive in the network. FTP/SMB. | Wireshark, ping |
| Recording interrupted | Increase the connection timeout in the camera settings or NAS (for example, FTP timeout = 300). | FileZilla Server, vsftpd.conf |
To save space:
- π Reduce the bitrate of video in the camera settings (e.g., from 4 Mbps to 2 Mbps).
- π Enable the recording only by movement (in Mi Home or third-party software).
- ποΈ Set up automatic cleanup of old files via Task Scheduler (Windows) or cron (Linux/NAS).
Xiaomi cameras with firmware for the region βRussiaβ (server ru) often blocked RTSP and ONVIF. To unlock these features, you need to change region to China Mainland or Europe via the Mi Home app (requires you to create a new account in the corresponding region).
π‘
For maximum stability, use a wired connection (Ethernet) for both the camera and the camera. NAS. Wi-Fi can cause delays and breaks in recording.
6.Security: How to Protect Records from Hacking
Security camera footage is sensitive data that needs to be protected.
- π Hacking through weak passwords (especially relevant for the FTP).
- π΅οΈββοΈ Traffic interception (if you use unencrypted protocols).
- π» Vulnerabilities in the firmware of the camera or NAS.
Protection measures:
- Give up. FTP favorably SFTP or SMB 3.0+ In Synology: activate. SFTP control panel β File service β FTP. Nana QNAP: use SMB encrypted (control panel) β Network services β Win/Mac/NFS β Additional settings).
- Set up. VLAN Set the cameras in a separate subnet (e.g, 192.168.2.x). Restrict access to this subnet only for NAS your PC.
- Update the camera firmware and NAS. Outdated versions of software often contain critical vulnerabilities (e.g, CVE-2021-31799 Xiaomi cameras).
Use two-factor authentication (2FA).
- To access NAS (for example, Synology or QNAP support 2FA).
- For your Mi Home account (if you use cloud access).
Cloud Leak Warning: If youβre using Mi Cloud in parallel, remember that Xiaomi stores data on servers in China (for China Mainland) or Singapore (for Europe).
π‘
For extra protection, set up fail2ban on NAS β it's blocking IP-Addresses after several failed attempts to enter.
Comparison of recording methods NAS: pick?
The choice of method depends on your tasks, budget and technical skills.
| Method | Difficulty | Cost | Supported cameras | Pluses | Cons |
|---|---|---|---|---|---|
| Official FTP (via Mi Home) | β | Free of charge. | C400, 2K Pro (ONVIF) | Simplicity, no additional software | It doesn't work on all models. |
| Home Assistant + FFmpeg | βββ | Free of charge. | Any (through) RTSP) | Flexibility, integration with a smart home | Requires a separate device |
| iSpy | ββ | Free (up to 4 cameras) | Any (through) RTSP/ONVIF) | Simple interface, motion recording | Windows only, limited in the free version |
| Blue Iris | βββ | $50 | Any (through) RTSP/ONVIF) | Professional functions, stability | Paid, requires a powerful PC |
| RTSP + FFmpeg (manual script) | ββββ | Free of charge. | Any (supported) RTSP) | Maximum control, no restrictions | Hard to set up, no graphical interface |
For most users, the best solution is:
- π Home use (1-2 Cameras: iSpy or Home Assistant.
- π’ Office/Multiple Cameras: Blue Iris or FFmpeg.
- π° Minimum budget: official FTP (If supported, or Home Assistant on Raspberry Pi.
π‘
If you need a record. 24/7 With multiple cameras, select a separate PC or virtual machine for this. NAS. Video recording is a resource-intensive task, and sharing with other services can lead to lags.
FAQ: Frequent questions about setting up
β Xiaomi cameras are written in format.mp4 or.h264? What player to use to watch?
β Can I write down NAS microSD at the same time?
β Why Xiaomiβs camera doesnβt connect to the camera NAS down FTP?
Network restrictions:
- Camera and NAS It should be on the same subnet (for example, 192.168.1.x).
- If you use Wi-Fi, check the signal stability (better to use a cable).
For diagnosis:
- Try to connect to FTP from PC via FileZilla or Command Prompt (ftp 192.168.1.100).
- Check the logs. NAS For errors (on Synology: Registration Center) β Magazines β Connections).