[Frigate+ RPi5] Hardware acceleration not working

I am a little lost as to how to enable hardware acceleration on Frigate.
I have two IP cameras with H.264 stream through RTSP (unfortunately I can’t change it to H.265, it’s a cheap Chinese camera).
As I understand, RPi 5 doesn’t have hardware H.264 decoding.
Is there any other way to enable hardware acceleration?
Right now the CPU gets easily gets to 50-85% with just frigate running…
I thought about converting H.265 to H.264 but that’ll be also CPU intensive I guess.
Please help!

This is my config.yml:

mqtt:
  enabled: true
  host: pi.local
  port: 1883
  topic_prefix: frigate

cameras:
  entrance:
    ffmpeg:
      inputs:
        - path: rtsp://... #low-res stream
          roles:
            - detect
        - path: rtsp://... #high-res stream
          roles:
            - record
    detect:
      enabled: true
      width: 640
      height: 360
      fps: 5
    record:
      enabled: true
      retain:
        days: 0
      alerts:
        retain:
          days: 3
      detections:
        retain:
          days: 3
    snapshots:
      enabled: true
      retain:
        default: 7
    motion:
      threshold: 30
      contour_area: 10
      improve_contrast: true
    objects:
      track:
        - person

  backyard:
    ffmpeg:
      inputs:
        - path: rtsp://... #low-res stream
          roles:
            - detect
        - path: rtsp://... #high-res stream
          roles:
            - record
    detect:
      enabled: true
      width: 640
      height: 360
      fps: 5
    record:
      enabled: true
      retain:
        days: 0
      alerts:
        retain:
          days: 3
      detections:
        retain:
          days: 3
    snapshots:
      enabled: true
      retain:
        default: 7
    motion:
      threshold: 30
      contour_area: 10
      improve_contrast: true
    objects:
      track:
        - person

version: 0.15-1

And this is how I run Frigate in Docker:

docker run -d --name frigate \
  --privileged \
  --restart=unless-stopped \
  --shm-size=74m \
  --mount type=tmpfs,target=/tmp/cache,tmpfs-size=128000000 \
  -v ~/frigate/config:/config \
  -v ~/frigate/media:/media/frigate \
  -v /etc/localtime:/etc/localtime:ro \
  -p 5000:5000 \
  --device /dev/dri:/dev/dri \
  ghcr.io/blakeblackshear/frigate:stable

Correct

You need a detector. I use Coral. It is quite well documented

In my small experience, two cameras (even with Coral) is the limit with Pi5. I run Frigate on both NUC and Pi5 (both with Coral)

The reason you use H264 is because it has greater compatibility with browsers. It is a rights thing.

I have no experience of Docker. The documentation recommends “bare metal”

1 Like