docs:nvr:moonfire

Moonfire NVR

将moonfire执行文件复制到用户bin目录:sudo install -m 755 “moonfire-nvr-v0.7.20-x86_64” /usr/local/bin/moonfire-nvr

添加新用户并设置home文件夹:sudo useradd –user-group –create-home –home /var/lib/moonfire-nvr moonfire-nvr

编辑配置文件:nano /etc/moonfire-nvr.toml

[[binds]]
ipv4 = "0.0.0.0:8080"
allowUnauthenticatedPermissions = { viewVideo = true }
 
[[binds]]
unix = "/var/lib/moonfire-nvr/sock"
ownUidIsPrivileged = true

初始化moonfire:sudo -u moonfire-nvr moonfire-nvr init

授权视频存储目录:sudo install -d -o moonfire-nvr -g moonfire-nvr -m 700 /mnt/moniter-usb/home/video

配置:sudo -u moonfire-nvr moonfire-nvr config 2>debug-log

编辑配置文件:nano /etc/systemd/system/moonfire-nvr.service

[Unit]
Description=Moonfire NVR
After=network-online.target
 
# If you use an external hard drive, uncomment this with a reference to the
# mount point as written in `/etc/fstab`.
# RequiresMountsFor=/media/nvr
 
[Service]
ExecStart=/usr/local/bin/moonfire-nvr run
Environment=MOONFIRE_FORMAT=systemd
Environment=MOONFIRE_LOG=info
Environment=RUST_BACKTRACE=1
Type=notify
# large installations take a while to scan the sample file dirs
TimeoutStartSec=300
User=moonfire-nvr
Restart=on-failure
CPUAccounting=true
MemoryAccounting=true
BlockIOAccounting=true
 
[Install]
WantedBy=multi-user.target

systemctl daemon-reload

systemctl start moonfire-nvr

如果需要启用监视画面,则必须将子流设置为Record,否则只能查看已录制画面。

  • docs/nvr/moonfire.txt
  • 最后更改: 2025/03/22 15:18
  • ossdate