[Frigate & RPi4] High CPU usage for FFmpeg

I am running Frigate on Raspberry Pi 4 with CPU detector.
The stats show that FFmpeg even uses more CPU than the detection.
Is it normal? I remember that hardware acceleration can be used for FFmpeg?

Setup

  • Add-on: Frigate (Full Access)
  • Camera: WebRTC camera via source type Hass
  • Frigate config (with bundled go2rtc):
mqtt:
  enabled: True

birdseye:
  enabled: False

ffmpeg:
  hwaccel_args:
    - -c:v:1
    - h264_v4l2m2m
  output_args:
    record: -f segment -segment_time 10 -segment_format mp4 -use_wallclock_as_timestamps 1 -strftime 1 -c:v copy -c:a copy
    rtmp: -c:v copy -c:a copy -f flv

rtmp:
  enabled: False

detect:
  width: 1920
  height: 1080
  fps: 5

objects:
  track:
    - person

record:
  enabled: True
  retain:
    days: 0
  events:
    pre_capture: 5
    post_capture: 5
    objects:
      - person
    required_zones:
      - driveway

snapshots:
  enabled: True
  timestamp: True
  required_zones:
    - driveway

go2rtc:
  streams:
    camera.garage_camera:
      - hass://supervisor?entity_id=camera.garage_camera
      - "ffmpeg:camera.garage_camera#audio=aac"

cameras:
  garage_camera:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/camera.garage_camera?video=copy&audio=aac
          roles:
            - detect
            - record
            - rtmp
    zones:
      driveway:
        coordinates: ...

This is normal for CPU detector

No amount of hardware acceleration will help on a RasPi. You need to get Google Coral to lower cpu usage.

It uses ffmpeg as part of detect when cpu only. If you use gpu work is offloaded to that. If Coral TPU, coral will be used.

You will struggle with frigate on an old pi, Probably even the new PI.

especially the new Pi because the new Pi does not even have h264 decoder in hardware