Connecting Xiaomi’s camera to NAS-Storage: Complete instructions from A to Z

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.

πŸ“Š What Xiaomi Camera Are You Using?
Mi Home Security Camera 1080p
Mi Camera 2K/2K Pro
Xiaomi C300/C400
Another model
I don't know.

Preparation NAS-camera-recording

Before setting up the camera, you need to prepare the network storage itself. NAS, But the steps are the same:

  1. Create a separate folder for records (for example, /video/xiaomi_cam). This will make it easier to manage files and configure access rights.
  2. 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.
  3. 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:

  1. Open the control panel. β†’ Shared folder.
  2. Create a new folder (for example, xiaomi_cam).
  3. In the access settings add the user camera_user recording-wise.
  4. 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:

  1. Install Home Assistant on a separate device (Raspberry Pi, old PC, or even Docker on the device itself). NAS).
  2. 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.)
  3. 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.)
  4. 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:

  1. Download and install iSpy from the official website.
  2. 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:

  1. Install Blue Iris and add a camera through Add Camera β†’ Find/Inspect (The program will find Xiaomi on the network).
  2. In the camera settings, specify RTSP-flow (example) URL for the Mi Camera 2K): rtsp://admin:[PASSWORD]@[IP]:554/stream1
  3. 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?
Many Xiaomi cameras are hidden RTSP-stream, but it can be activated through informal methods: 1. Use the Mi Home Hack (GitHub) utility to enable RTSP on camera without official support. 2. For the Mi Camera 2K Pro URL flow-like: rtsp://[IP]:554/stream1 (default login/password: admin/idle admin/123456). 3. Check the ports: sometimes Xiaomi uses a custom port 34567 instead 554.

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.DecisionTools
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 fragmentationUse the Btrfs file system or ZFS (They're better at handling small files).Synology DSM, TrueNAS
The camera loses its connection to NASCheck network stability (use cable instead of Wi-Fi) and set up keepalive in the network. FTP/SMB.Wireshark, ping
Recording interruptedIncrease 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:

  1. 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).
  2. 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.
  3. 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.

MethodDifficultyCostSupported camerasPlusesCons
Official FTP (via Mi Home)⭐Free of charge.C400, 2K Pro (ONVIF)Simplicity, no additional softwareIt doesn't work on all models.
Home Assistant + FFmpeg⭐⭐⭐Free of charge.Any (through) RTSP)Flexibility, integration with a smart homeRequires a separate device
iSpy⭐⭐Free (up to 4 cameras)Any (through) RTSP/ONVIF)Simple interface, motion recordingWindows only, limited in the free version
Blue Iris⭐⭐⭐$50Any (through) RTSP/ONVIF)Professional functions, stabilityPaid, requires a powerful PC
RTSP + FFmpeg (manual script)⭐⭐⭐⭐Free of charge.Any (supported) RTSP)Maximum control, no restrictionsHard 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?
Xiaomi cameras record video in format H.264 (codec) with container.mp4 Or.mkv (depending on the firmware: 🎬 VLC Media Player (cross-platform, supports all codecs). πŸ–₯️ PotPlayer (Windows, the best hardware acceleration support). πŸ“± MX Player (Android) or nPlayer (iOS) If the video isn't playing, try recoding it via HandBrake or updating your codecs on your PC (e.g., K-Lite Codec Pack).
❓ Can I write down NAS microSD at the same time?
Yes, but with reservations: πŸ”„ Xiaomi cameras do not support simultaneous recording NAS And microSD. Priority is given. NAS, MicroSD is used as a backup when the network is broken. πŸ› οΈ Bypass: Use Home Assistant or iSpy to duplicate the stream. For example, in iSpy you can set up a record to NAS And locally on a PC, and then sync the local folder to a microSD via Robocopy (Windows) or rsync (Linux.
❓ Why Xiaomi’s camera doesn’t connect to the camera NAS down FTP?
Problems with FTP-Connection is usually associated with: Incorrect settings NAS: Check that FTP-server running (on Synology: Control Panel) β†’ File service β†’ FTP). Make sure the port is 21 firewall NAS Errors in the data to connect: The path to the folder must be in the format /video/xiaomi_cam (without disc indication, for example, C:\). Passwords should not contain Cyrillic or special characters (use only Latin and numbers).

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).
❓ How to reduce the size of records without loss of quality?
You can reduce the amount of recordings in several ways: Camera settings: Reduce resolution (for example, with the camera). 2K before 1080p). Lower bitrate to 1-2 Mbps (at Mi Home) β†’ Camera settings β†’ Quality.