[SUPPORT] blakeblackshear - Frigate


174 posts in this topic Last Reply

Recommended Posts

Hello

 

I'm about to add Coral to Frigate and wonder which m2 module I need? My motherboard have spare m2 key E.

M.2 Accelerator A+E key

M.2 Accelerator with Dual Edge TPU

 

First is A+E key second is E key is it supported by drivers?

Link to post
  • Replies 173
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

I released now a Plugin for Unraid 6.9.0rc2 and up so that the installation of the Drivers is as easy as going to the CA App and search for 'Coral-Driver'.   It will take about an hour to sh

Hi @mathgoy, I've been using Frigate with an NVIDIA GPU.   to set it up, go the the docker template and add: --rm --runtime=nvidia to the "Extra Parameters".   Y

I recently got the mini PCIe Coral. Not knowing it was any different than PCIe. Then the adapter and started searching on how to get it working.   I registered on the forum to say thanks &am

Posted Images

Posted (edited)
41 minutes ago, nau said:

Hello

 

I'm about to add Coral to Frigate and wonder which m2 module I need? My motherboard have spare m2 key E.

M.2 Accelerator A+E key

M.2 Accelerator with Dual Edge TPU

 

First is A+E key second is E key is it supported by drivers?

As far as I know, the TPU chip inside the all Coral boards is the same, so the driver should be valid for all of the coral PCI-M2 devices. Correct me please... @ich777

Edited by yayitazale
Link to post
16 minutes ago, yayitazale said:

As far as I know, the TPU chip inside the all Coral boards is the same, so the driver should be valid for all of the coral PCI-M2 devices. Correct me please... @ich777

I actually don't own such a device, if someone want's to donate one to me... :D 🤑

 

From what I've know the chips on every Coral Accelerator device is the same some devices have one and some two from what I know.

Link to post
23 minutes ago, ich777 said:

I actually don't own such a device, if someone want's to donate one to me... :D 🤑

 

From what I've know the chips on every Coral Accelerator device is the same some devices have one and some two from what I know.

I only own a USB coral so I don't need drivers to make it work and I can use it on mobile proyects with a raspi. 🤑🤑🤑

Link to post

Thanks yayitazale

 

I got the addon running in Home Assistant and its recognizing my USB Coral, having problems with the hardware acceleration but thats another story!

 

I'v hit a hurdle though, reason I wanted Frigate in a docker was due to easily mounting my Unraid unassigned drive to it to store all the media from the camera, I have been googling how to pass the same drive to a Home Assistant VM and to be honest struggling! As i am just constantly filling up my cache drive.

 

Any idea if there is going to be a Unraid docker created for Frigate for the OLD CPU version?

 

Do you plan on keeping this version, addon and possibly Docker version updated in the future?

 

Really want to say thanks for all the work you have done, i'm just trying to work out if I have to save up and invest in some new hardware, you wouldn't believe the hours I have put into this to get as far as I am now 😕

What you have created is just perfect for my use case 🙂 and i hope to keep using it

 

Thanks 🙂

 

 

Link to post
21 hours ago, Allanon said:

Thanks yayitazale

 

I got the addon running in Home Assistant and its recognizing my USB Coral, having problems with the hardware acceleration but thats another story!

 

I'v hit a hurdle though, reason I wanted Frigate in a docker was due to easily mounting my Unraid unassigned drive to it to store all the media from the camera, I have been googling how to pass the same drive to a Home Assistant VM and to be honest struggling! As i am just constantly filling up my cache drive.

 

Any idea if there is going to be a Unraid docker created for Frigate for the OLD CPU version?

 

Do you plan on keeping this version, addon and possibly Docker version updated in the future?

 

Really want to say thanks for all the work you have done, i'm just trying to work out if I have to save up and invest in some new hardware, you wouldn't believe the hours I have put into this to get as far as I am now 😕

What you have created is just perfect for my use case 🙂 and i hope to keep using it

 

Thanks 🙂

 

 

I'm not the developer of the app, I'm just mantaining the Template of the container for Unraid. The modified addon is mainteined by another guy so ask him if he is going to maintain it. https://github.com/pdecat

Link to post
2 hours ago, Allanon said:

I have found this    https://community.home-assistant.io/t/solved-hassos-mount-nas-network-share/303292

 

Honestly I understand about 1 word in 5,  does anyone with more knowledge agree this is the best way on Unraid to get more storage to the Frigate addon for longer term camera storage rather than saving it on a cache ssd?

 

Thanks 

Do yo know on whitch folder of hass is storing all the media?

 

Link to post
4 hours ago, yayitazale said:

Do yo know on whitch folder of hass is storing all the media?

 

As part of the normal SMB shares that are created, there is Home Assisted Share called media which then has

media\frigate

media\cache

 

frigate and cache are created by the frigate addon

 

image.png.885ffa63a474be76f91939229f245c1f.png

Link to post
Posted (edited)
21 minutes ago, Allanon said:

As part of the normal SMB shares that are created, there is Home Assisted Share called media which then has

media\frigate

media\cache

 

frigate and cache are created by the frigate addon

 

image.png.885ffa63a474be76f91939229f245c1f.png

Ok, so if you want to avoid using SSD cache you just can add a path to mount the media folder onto a non cache share of unraid.

 

Create a new share on unraid and set the use of cache to "no", like this, including the disks you want to use to store NVR:

 

imagen.thumb.png.da7a384d0ba3cb96ff14419d501745e8.png

 

Be aware that this is going to increase a lot the write/reads on your disk, so I recomend you to use a proper disk to do this job (a WD purple series or so https://amzn.to/3e6UIjC (refered link)). You should config all your shares except the NVR one to not to use this disk and only use it to store NVR)

 

Then go to your hass container and edit it. You need to add a folder path and point the /media/frigate folder of the container to the non cache share, something like this:

 

imagen.thumb.png.19d2ae3d400820d06c57f01fe8632295.png

 

Apply the change and now all the new media created on the /media/frigate folder on hass will be stored on that folder of unraid, skipping the cache disks.

 

 

Edited by yayitazale
Link to post
5 minutes ago, yayitazale said:

Ok, so if you want to avoid using SSD cache you just can add a path to mount the media folder onto a non cache share of unraid.

 

Create a new share on unraid and set the use of cache to "no", like this, including the disks you want to use to store NVR:

 

imagen.thumb.png.19456ea9784a0326a9e2271b75d3f2f5.png

 

Be aware that this is going to increase a lot the write/reads on your disk, so I recomend you to use a proper disk to do this job (a WD purple series or so https://amzn.to/3e6UIjC (refered link)). You should config all your shares except the NVR one to not to use this disk and only use it to store NVR)

 

Then go to your hass container and edit it. You need to add a folder path and point the /media folder of the container to the non cache share, something like this:

 

imagen.thumb.png.19d2ae3d400820d06c57f01fe8632295.png

 

Apply the change and now all the new media created on the /media folder on hass will be stored on that folder of unraid, skipping the cache disks.

imagen.png

imagen.png

 

Thanks yayitazale

 

Sorry I should have said I have tried before to add unassigned drives to home assistant VM, basically the same way as you explained above and how i have successfully done it before in Docker.

 

Unfortunately the Home Assistant VM always hangs then and I dont know how to troubleshoot that. 

 

Not sure if you use Home Assistant but any googling on this subject seems to point to it being very locked down intentially, hence the complicated instructions in the link I provided earlier.

 

On my way out now but will try again as per your instructions and see if I can find some logs or something.  Appreciate the help thank you!

 

 

Link to post

Just wanted to give you guys an update...

 

I installed the m.2 A+E coral card into the wifi slot on my itx motherboard. It has cut down on my CPU usage while detecting 8 rtsp camera feeds. Two of which have a lot of car movement on a busy street. This used to put the pain on my i5 9400 cpu (about 70% usage) if I did not mask out the street. Now my CPU is sitting at ~25% usage and that is without the masks! The coral ai chip is doing great. Now I need to figure out how to get the frigate.process using less CPU. Although 25% is not too bad for now I suppose.

 

Thanks again yayitazale!

Link to post

Hi

Same feedback as @remati here.

Just loaded my M.2 Dual edge TPU (using a PCIE adator) and it worked right off the bat.

 

However, I am struggling with the Nvidia Hardware acceleration.

I pulled the nvidia version of the docker and added the 2 environment variables as explained in the documentation.

There is one sentence I don't understand in the documentation though.

 

Quote

In order to pass NVDEC, the docker engine must be set to nvidia

 

What does it mean?

 

For your information, the error I get for the stream I am trying to process with my nvidia card is the following:

[h264_cuvid @ 0x563acb21c380] Failed loading nvcuvid.
[h264_cuvid @ 0x563acb21c380] Cannot load libnvcuvid.so.1

 

Thanks for your help!

Link to post
53 minutes ago, mathgoy said:

Hi

Same feedback as @remati here.

Just loaded my M.2 Dual edge TPU (using a PCIE adator) and it worked right off the bat.

 

However, I am struggling with the Nvidia Hardware acceleration.

I pulled the nvidia version of the docker and added the 2 environment variables as explained in the documentation.

There is one sentence I don't understand in the documentation though.

 

 

What does it mean?

 

For your information, the error I get for the stream I am trying to process with my nvidia card is the following:


[h264_cuvid @ 0x563acb21c380] Failed loading nvcuvid.
[h264_cuvid @ 0x563acb21c380] Cannot load libnvcuvid.so.1

 

Thanks for your help!

¿Did you install the Unraid Nvidia plugin? I dind't have time to create a nvidia frigate version but I can try to create it this weekend. Not sure about how complex the hard acc env variable setup will be...

Link to post
1 hour ago, yayitazale said:

¿Did you install the Unraid Nvidia plugin? I dind't have time to create a nvidia frigate version but I can try to create it this weekend. Not sure about how complex the hard acc env variable setup will be...

hi, Thanks for your feedback

Yes I did install the Unraid Nvidia Plugin and it is functionnal with Plex for instance.

Please let me know about any information I could help you with

Link to post

Hi, maybe a stupid question but can I use Frigate without setting up MQTT? Right now I am not interested in the HomeAssistant integration. I just like to try it as a normal NVR.

Link to post

Hi @mathgoy,

I've been using Frigate with an NVIDIA GPU.

 

to set it up, go the the docker template and add:

 --rm --runtime=nvidia

to the "Extra Parameters".

FAdwEa6.png

 

You will also need to add two new Variables: "NVIDIA_VISIBLE_DEVICES" and "NVIDIA_DRIVER_CAPABILITIES":

p7pJnFj.png

 

After that you should be able to run "nvidia-smi" in the docker console:

OkmdRcL.png

 

Note that you won't get anything under processes here even after you'll get the GPU decoding to work.

 

After that you should adjust you're config to use the HW decoding. see here:

https://blakeblackshear.github.io/frigate/configuration/nvdec

 

Those are my changes:

tksP1hg.png

(all my cameras are 1080P h264)

 

When you're done you should be able to see the GPU being used by running "nvidia-smi" from the Unraid console:

AfMLlKc.png

 

I have 8 cameras, so 8 processes (and another one is Deepstack).

 

Hope it helps.

 

 

  • Like 1
  • Thanks 1
Link to post
19 hours ago, sylus said:

Hi, maybe a stupid question but can I use Frigate without setting up MQTT? Right now I am not interested in the HomeAssistant integration. I just like to try it as a normal NVR.

Yes, you can use it as standalone service but keep in mind that there is no notification channel implemented aside from mqtt.

Link to post

Hi @IpDo

 

Thanks for the Tips.
I did exactly what you were advising and It worked.
I was missing the GPUID (i was using 'all" as it is mentioned in the documentation) as well as the extra arguments

 

After it worked with the regular template, I moved to the new frigate-nvidia template (big thanks to @yayitazale) and it was even easier since all the variables were created.

 

Just one thing.

In the YAML config file, the documentation is telling us to add the following to enable the hardware decoding:

image.png.469b782d0aaf73776120fc71b91b9081.png

 

It didn't work for me and it crashed the docker (even deleting it for some reason, several times!)

Instead of that, I followed your recommendations and added the following which worked like a charm:

image.png.b1e42f9d2c6dbd448c80462389293fd6.png

 

Thanks again mate

Link to post

Thanks a lot for the nvidia version! Gave it a go yesterday and I really love it :)

One thing I noticed is that if you mess the config up, or if a process crashes in frigate, the whole docker container is marked as orphan in unraid and you need to redeploy it (using previous apps for example).
I'm guessing this is a unraid template error and not related to blakeblackshear's image.

Link to post
1 hour ago, martikainen said:

Thanks a lot for the nvidia version! Gave it a go yesterday and I really love it :)

One thing I noticed is that if you mess the config up, or if a process crashes in frigate, the whole docker container is marked as orphan in unraid and you need to redeploy it (using previous apps for example).
I'm guessing this is a unraid template error and not related to blakeblackshear's image.

I will check it this weekend

Link to post
Posted (edited)
7 hours ago, yayitazale said:

I will check it this weekend

Just some further inputs:

If you use the "regular" docker and manually add the nvidia GPU support, the whole container will be marked as oprhan when it crashes too.

Also, when you reboot your server, the container will also disappear.

Edited by mathgoy
Link to post
2 hours ago, yayitazale said:

I will check it this weekend

Thanks! Forgot to add an example, try removing - detect from a camera and restart the container.

 

Error parsing config: The detect role is required for dictionary value @ data['cameras']['test']['ffmpeg']['inputs']
e":"No such container: ddf6dc9c7a50"}


Att startup when checking the logs it will throw the above error, then the container will become orphan.

And as @mathgoy seems to have found this issue is in the original frigate template as well so maybe you wont find it that easy =/
 

Link to post
On 5/9/2021 at 11:10 AM, IpDo said:

Hi @mathgoy,

I've been using Frigate with an NVIDIA GPU.

 

to set it up, go the the docker template and add:




 --rm --runtime=nvidia

to the "Extra Parameters".

FAdwEa6.png

 

You will also need to add two new Variables: "NVIDIA_VISIBLE_DEVICES" and "NVIDIA_DRIVER_CAPABILITIES":

p7pJnFj.png

 

After that you should be able to run "nvidia-smi" in the docker console:

OkmdRcL.png

 

Note that you won't get anything under processes here even after you'll get the GPU decoding to work.

 

After that you should adjust you're config to use the HW decoding. see here:

https://blakeblackshear.github.io/frigate/configuration/nvdec

 

Those are my changes:

tksP1hg.png

(all my cameras are 1080P h264)

 

When you're done you should be able to see the GPU being used by running "nvidia-smi" from the Unraid console:

AfMLlKc.png

 

I have 8 cameras, so 8 processes (and another one is Deepstack).

 

Hope it helps.

 

 

 

 

Thank you  @Newbie for sharing it was successful

I got a problem at first then I found a solution that could help the members
Problem is video distortion :

bJ9JpqU.png

 

I am not an expert but I found a simple solution

VLC player To get the correct dimensions for the video
The solution :
1- Using the media player: VLC
2- run  RTSP link ( Media >> Open Network Strem ) ORCtrl + N )
3- go to :  Tools >> Codec information ORCtrl + J 

wcled0V.png

 

Now, correct the config.yml 

    width: 704

    height: 576

 

___________________________________

cameras:
  # Name of your camera
  camera1:
    ffmpeg:

      inputs:
        - path: rtsp://USER:PASSWORD@192.168.1.60:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp
            #- clips
        - path: rtsp://USER:PASSWORD@192.168.1.60:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips

    width: 704

    height: 576

    fps: 15

___________________________________

Now all cameras are working fine 👍

 

 

If you see that my config are incorrect please inform me 

 

my config:

ffmpeg:
  hwaccel_args:
    - -hwaccel
    - cuda
    - -c:v 
    - h264_cuvid

  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1 -c:v h264_cuvid
  #input_args: []
  output_args:
    # Optional: output args for detect streams (default: shown below)
    detect: -f rawvideo -pix_fmt yuv420p -filter:v fps=fps=5
    # Optional: output args for record streams (default: shown below)
    record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
    # Optional: output args for clips streams (default: shown below)
    clips: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
    # Optional: output args for rtmp streams (default: shown below)
    #rtmp: -c copy -f flv
    rtmp: -c copy -map 0 -f flv
mqtt:
  host: 192.168.1.XX
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: XXXX
  password: XXXXXX
  stats_interval: 60
  
cameras:
  # Name of your camera
  camera1:
    ffmpeg:
      inputs:
        - path: rtsp://USER:PASSWORD@192.168.1.60:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - detect
            - rtmp
            #- clips
        - path: rtsp://USER:PASSWORD@192.168.1.60:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips
    width: 704
    height: 576
    fps: 15
    
    
objects:
  track:
    - person
    - cat
    - dog
    - car 
  filters:
    person:
      #min_area: 5000
      #max_area: 100000
      #min_score: 0.6
      threshold: 0.7
      
      
detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.