Frigate media location questions

Hello everyone…

I am an eager learner on this home assistant subject and i now work on my frigate implemenation…
So far so good…
I got most of it working and am currently working on the “store clips and recording on NAS” subject.
So far i learned, that frigate wants to save the mdeia and db into the /media/frigate folder…
I followed some youtube vids and mounted that folder to my nas an i see all my NAS files as planned…
Frigate also records like a charm…BUT…the files dont land on my NAS and ls -l into /media/frigate only shows me what i already see in my NAS folder via windows explorer view…
Where in the world are the recodring?!
I can see and view them in the media browser when i drill into the Frigate card in the media browser view…but i cannot find them in the file system…
I also have the samba smb backup addon installed and checked that file and the recordning are in the backup and they are where i would expect them…in the media.tar which most likely in my understanding is representing the media folder in the file system of hass…
So please help…where is my disconnect?
My NAS mount is set up like this:

shell_command:
  mount_nas_folder: mkdir -p /media/frigate;mount -t cifs -o username=xxxx,password='xxxx',domain=workgroup //192.168.178.60/Recordings /media/frigate

and it comes up as mounted when i check via mount command
I automated it via “when home assistant starts” and i am not quite sure how i could have messed it up…

Thx for any help…

Home Assistant 2022.9.7
Supervisor 2022.09.1
Operating System 9.0
Frontend 20220907.2 - latest

Sooo…i have been playing a little with the problem…
It gets even more confusing…
I umounted the /media/frigate folder and renamed it on the NAS for frigate_old
Then i wnet to the Home Assistant media browser and even though that the cifs mount is disconnected, it shows the NAS content with the just a minute ago changed frigate_old folder that was changed AFTER i dismounted the frigate folder.
The even more creepy part is this:
when i cd into /media and ls the content, i get shown several things and the frigate folder (without the _old)
When i try to cd into that being in the media folder, it says no such folder or directory
When i go into root by cd / and do then cd /media/frigate i get into the frigate folder all the sudden without the error message and it shows me non of the NAS stuff but the recordings and the path is underlined which it is not when i frill into it when i am connected to the NAS via cifs…
Does that make any sense to anyone?
And if, can someone help me out of my misery?
All i want it that the frigate folder is connected to my NAS and the recordings with it…
I was actually hoping to do that by the above mentioned mount, but somehow…
Any symlinks involved that i am not aware of due to the docker containers talking to each other in the background or something like that?

Thx for any ideas…

Found issue and fixed…

can you share your solution?

Wil, as soon i have a quiete moment at the pc, on phone this is a pain

Ok…lets see…

So i created a set of keys in ubuntu and saved public key on my usb stick an my documents folder
I plugged the usb stick with the caption CONFIG as device name into the hass machine and restarted machine from power down up.
On top i installed HassOS SSH port 22222 Configurator addon from the hacs store and copied the public key into that as well and let it do its thing
now i used putty and used the created private key for authorization and connected to the hass machine ip and got greeted with a nice welcome
Via console it would look like this ssh root@IP -p 22222 -i /ssl/private_key
from there i than used this active connection to mount media folder from frigate to my nas and automated it in the configuration.yaml
shell_command:
mount_frigate_nas: ssh root@ip -p 22222 -i /ssl/private_key -o “StrictHostKeyChecking=no” -C “mkdir -p /mnt/data/supervisor/media/frigate && mount -t cifs -o username=user,password=‘password’,domain=workgroup //ip/Recordings/frigate /mnt/data/supervisor/media/frigate”

that was it…hope that helps

1 Like

Thanks for your reply

Do you have Frigate as HA addon or is standalone?

I have the first one and I was wondering how to check if it’s available also in Frigate and how to define in frigate.yml

Do you have any idea?

Thanks

I have it as a ha addon…
So which part is now of your interest?

Thanks for your reply.
I would like to use a NAS storage folder for clips and snapshots and don’t know how to do it.

How can I define it in HA and is it visible also in the Frigate add-on?

That was exactly the reason why i did it myself
First tried to mount the frigate folder from co tainer but that did not do the trick…
So create yourself a pair of keys…i used ubuntu…or putty…
Than create a usb stick qith fat32 format and call it CONFIG in capital letters and put the public key that you called authorized_keys on it(no ppk or pub extension…
Plug it into the ha machine and restart it complete from power off to running
Now you should get a result when you try to ssh to ip of machine qith port 22222
When that is working, you are half way there

Now you ssh into the ha machine with this command
ssh root@ip -p 22222 -i /ssl/private_key
And you should be greeted with a successful login…
From there it is just mounting the nas folder and utting the logic for mounting into a shell command for start up automation and you are golden

Note that the process described by Darkyputz is explained in depth at: https://seanblanchfield.com/2022/05/frigate-nas-in-homeassistant-os

I know this is for SAMBA or NAS, But if someone else looks at this for Local USB Media, I used this link below. And after doing the CONFIG label on the drive, changed the label to ‘frigate’, I moved the old frigate folder out of the way in /media/frigate to /media/frigate_old. plugged in the drive labeled ‘frigate’, and then copied the contents of /media/frigate_old to the new mounted drive /media/frigate. Then Started Frigate back up.