Direkt zum Hauptinhalt

Installation als LXC Container und Einbindung in Home Assistant

Beschreibung:

Sollte Home Assitant nicht auf einem Rasperrry oder nativ laufen sondern in einer VM.
Dann sollte Frigate in einem LXC Container installiert werden, damit wir HW Beschleunigung für Video benutzen können.

Installation des Containers mittels den Helper scripten

Die Frigate LXC Seite dazu : https://tteck.github.io/Proxmox/#frigate-lxc 

Wichtig in der Proxmox Webgui shell ausführen nicht nativ ssh!!!
Und Standard installation auswählen, nicht Advanced!!!

bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/frigate.sh)"

Installation Fertig...

Auswahl_398.png

Nach dem das Script durchgelafuefn ist, ist der Server über : IP:5000 erreichbar

Das script schleift uns schon die Grafikkarte durch.
Wir brauchen dann nur noch in der lxc .conf

nano /etc/pve/lxc/<vmid>.conf

Beispiel

nano /etc/pve/lxc/102.conf

Folgenden Abschnitt an ende der Datei hinzufügen für den Coral USB Stick.
In der Letzten Zeile die BUS Nummer anpassen.
Mit lsusb herausfindbar

Output lsusb hier Bus 002

Bus 002 Device 003: ID 18d1:9302 Google Inc. 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0658:0200 Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) - UZB
Bus 001 Device 002: ID 0bda:c821 Realtek Semiconductor Corp. Bluetooth Radio 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Und der Code

lxc.cgroup2.devices.allow: c 189:* rwm
...
lxc.mount.entry: /dev/bus/usb/002 /dev/bus/usb/002 none bind,optional,create=dir

Nun Kann Frigate konfiguriert werden über die Config File in derGUI.
Nach jeder Änderung den Container stoppen und starten!!!

Netzlaufwerk einbinden

Die Eigentlichen Medien Dateien sollen auf ein NSF Netzlaufwerk gespeichert werden.
Dazu auf den NSF Server die IP des Frigate in die Ausnahmeliste hinzufügen.
Wir mounten unser Frigate Verzeichnis in den Standard Order im Container unter /media/frigate

Unsere NFS Freigabe heißt <ip-adresse>/frigate

In den Modul Option NFS anhaken

Auswahl_129.png

Danach die fstab anpassen:

nano /etc/fstab

Nun folgende Mount Zeile am ende einfügen und an eure gegebenheiten anpassen.

Inhalt:

...
<ip>:/<share_name> /media/frigate nfs rw,soft,intr,noatime 0 0



Example
192.168.178.75:/NFS_Frigate /media/frigate nfs rw,soft,intr,noatime 0 0

Nun noch das Paket nsf common installieren

apt install nfs-common

Und nun mit

mount /media/frigate

 das Verzeichnis mounten

Graffikarte prüfen

Unser LXC Container ist für die Grafikkarte schon vorbereitet.

Das Programm zum testen

apt install vainfo

Wenn alles geklappt hat, dann solltet Ihr diese Ausgabe bekommen.
Befehl:

vainfo

Ausgabe:

vainfo: VA-API version: 1.17 (libva 2.10.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.1.1 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD