frigate: [Support]: excessive CPU usage over 200 percent

Describe the problem you are having

Impossible CPU usage in frigate system GUI. SHOWS between 50-300 percent CPU usage not sure if it’s detecting multiple cores as one or something weird is going on (photo attached at bottom of this). Via terminal in Ubuntu checking actual cpu usage it averages 30-70 percent usage. What’s going on in frigate to show over 100 percent usage

Version

12.1

Frigate config file

ui:
  # Optional: Set the default live mode for cameras in the UI (default: shown below)
  live_mode: mse
  # Optional: Set a timezone to use in the UI (default: use browser local time)
  # timezone: America/Denver
  # Optional: Use an experimental recordings / camera view UI (default: shown below)
  use_experimental: False
  # Optional: Set the time format used.
  # Options are browser, 12hour, or 24hour (default: shown below)
  #time_format: browser
 # Optional: Set the date style for a specified length.
 # Options are: full, long, medium, short
  # Examples:
  #    short: 2/11/23
  #    medium: Feb 11, 2023
  #    full: Saturday, February 11, 2023
  # (default: shown below).
  #date_style: short
  # Optional: Set the time style for a specified length.
  # Options are: full, long, medium, short
  # Examples:
  #    short: 8:14 PM
  #    medium: 8:15:22 PM
  #    full: 8:15:22 PM Mountain Standard Time
  # (default: shown below).
 # time_style: medium
  # Optional: Ability to manually override the date / time styling to use strftime format
  # https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html
  # possible values are shown above (default: not set)
  #strftime_fmt: "%Y/%m/%d %H:%M"


#logger:
  # Optional: default log level (default: shown below)
  #default: warning
  # Optional: module by module log level configuration
 # logs:
    #frigate.mqtt: error

#timestamp_style:
  # Optional: Position of the timestamp (default: shown below)
  #           "tl" (top left), "tr" (top right), "bl" (bottom left), "br" (bottom right)
  #position: "tl"
  # Optional: Format specifier conform to the Python package "datetime" (default: shown below)
  #           Additional Examples:
  #             german: "%d.%m.%Y %H:%M:%S"
  #format: "%m/%d/%Y %H:%M:%S"
  # Optional: Color of font
 # color:
  # All Required when color is specified (default: shown below)
   # red: 255
   # green: 255
   # blue: 255
  # Optional: Line thickness of font (default: shown below)
  #thickness: 1
  # Optional: Effect of lettering (default: shown below)
  #           None (No effect),
  #           "solid" (solid background in inverse color of font)
  #           "shadow" (shadow for font)
  #effect: solid

mqtt:
  host: 192.168.1.44
  port: 1883
  user: mqtt
  password: Ju
  
#birdseye:
  #enabled: True
  #width: 1280
  #height: 760
  #quality: 1
  #mode: objects
  
birdseye:
    # Optional: Enable birdseye view (default: shown below)
  enabled: True
   # Optional: Width of the output resolution (default: shown below)
  width: 1280
   # Optional: Height of the output resolution (default: shown below)
  height: 720
    # Optional: Encoding quality of the mpeg1 feed (default: shown below)
    # 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
  quality: 1
    # Optional: Mode of the view. Available options are: objects, motion, and continuous
    #   objects - cameras are included if they have had a tracked object within the last 30 seconds
    #   motion - cameras are included if motion was detected in the last 30 seconds
    #   continuous - all cameras are included always
  mode: objects
  #restream: false
#database: 
#  path: /media/NAS/cctv/frigate/frigate.db
  
record:
  enabled: True
  retain:
    days: 30
    mode: motion
  events:
    retain:
      default: 30
      mode: active_objects

snapshots:
  enabled: true
  timestamp: false
  bounding_box: true
  retain:
    default: 30
    objects:
      person: 30
      
ffmpeg:
  hwaccel_args:
    - -hwaccel
    - cuda
    - -c:v 
    - h264_cuvid      



#Global Object Settings
objects:
  track:
    - person
    - car
    - cat
    - dog
  filters:
    person:
      min_area: 1000
      max_area: 100000

rtmp:
  enabled: false
  
go2rtc:
  streams:
    360cam:
      - rtsp://admin:Ju@192.168.1.66:554/MediaInput/h264
      - "ffmpeg:360cam#video=h264"
    front_entry:
      - rtsp://admin:Ju@192.168.1.226:554/cam/realmonitor?channel=1&subtype=0
      - "ffmpeg:front_entry#video=h264#audio=aac"
    front_deck:
      - rtsp://admin:Ju@192.168.1.30:554/Streaming/channels/201
    driveway_cam:
      - rtsp://admin:Ju@192.168.1.30:554/Streaming/channels/101   
    back_shed:
      - rtsp://admin:Ju@192.168.1.30:554/Streaming/channels/301   
    sand_pit:
      - rtsp://admin:Justj33p@192.168.1.30:554/Streaming/channels/401      
      

#########################################################################################################################################            
cameras:
########################################################################################################################################

  driveway_cam:
    ui:
      order: 0
    ffmpeg:
      inputs:
        - path: rtsp://admin:Ju@192.168.1.30:554/Streaming/channels/101
          roles:
            - record 
      #  - path: rtsp://admin:Ju@192.168.1.30:554/Streaming/channels/102
        #  roles:
            - detect       
    motion:
      mask:  
        - 2728,249,2859,734,2558,1225,2770,1188,3172,1099,3258,1008,3554,981,3840,905,3840,720,3840,0,2386,0,2428,249
        - 3350,2115,3266,1797,3458,1400,3700,1287,3732,1028,2080,1686,1844,2132
        - 463,1439,180,914,1255,298,1099,0,0,0,0,1910,387,2075
        - 2253,471,698,0,2277,0,2378,254,2455,510
    record:
      events:
        required_zones:
          - zone_driveway_cars
          - zone_driveway_all       
    zones:  
      zone_driveway_cars:
        coordinates: 2258,399,2568,641,2445,907,1607,969,2672,1434,2960,614
        objects:
          - car
        filters:
          car:
            min_area: 2000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.7

      zone_driveway_all:
        coordinates: 3123,688,2194,417,759,1720,279,1144,0,1388,0,1927,3335,2160
        objects:   
          - person
          - cat  
          - dog   

        filters:
          person:
            min_area: 1000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.7

          cat:
            min_area: 1000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.7
          
          dog:
            min_area: 1000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.7



   # snapshots:
    #  enabled: true
    #  ffmpeg:
    #    inputs:
    #      - path: rtsp://my_camera_ip_address/main
    #    width: 1920
    #    height: 1080   

    detect:
      width: 3840
      height: 2160
      fps: 5
    objects:
      filters:
        car:
          mask:
            - 2726,1284,1572,2160,540,2160,426,1553,1563,838
            - 1702,1053,1486,397,1999,291,2449,560
            - 1494,0,806,54,466,150,483,387,532,688,1267,288,1871,271,2869,574,3810,742,3818,25     
      track:
        - person
        - car
        - cat  
        - dog 
        
    snapshots:
      enabled: true
      clean_copy: true
      timestamp: false
      crop: true
      quality: 100
      retain:
        default: 20
        objects:
          person: 30

###############################################################################################################################
      

 #####################################################################################################################################                     

  front_entry:
    ui:
      order: 1
    ffmpeg:
      inputs:
        - path: rtsp://admin:Jus@192.168.1.226:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - record 
       # - path: rtsp://admin:Ju@192.168.1.226:554/cam/realmonitor?channel=1&subtype=1
       #   roles:
            - detect     
    motion:
      mask:    
        - 1758,1307,2769,2048,3072,2048,3072,876,2669,893
        - 3072,203,3072,969,2641,293,2693,28
        - 1189,0,1196,248,565,400,545,41
        - 45,210,52,772,431,596,362,103
        - 2727,28,2544,617,2151,958,2331,0
    zones:
      zone_front_entry_people:
        coordinates: 496,2048,317,1817,3051,1631,634,379,1214,414,2165,965,2582,555,3072,786,3072,1693,3072,2048
        objects:
          - person
        filters:
          person:
            min_area: 6500
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.78
      zone_front_entry_cat:
        coordinates: 214,1148,917,834,583,531,38,783 
        objects:
          - cat
          - dog
        filters:
          cat:
            min_area: 1000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.7
          
          dog:
            min_area: 1000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.7

    record:
      events:
        required_zones:
          - zone_front_entry_people
          - zone_front_entry_cat
    detect:
      width: 3072
      height: 2048
      fps: 5
    objects:
      filters:
        person:
          mask:
            - 545,428,434,607,59,776,0,1152,555,0,1207,0,1189,269
            - 2810,2048,3072,1645,0,1152,672,714
            - 145,955,317,1314,121,1452,0,1152    
      track:
        - person
        - dog
        - cat   
    snapshots:
      enabled: true
      clean_copy: true
      timestamp: true
      crop: true
      quality: 100
      retain:
        default: 20
        objects:
          person: 30
      
 ####################################################################################################################################################  
 
  front_deck:
    ui:
      order: 2
    ffmpeg:
      inputs:
        - path: rtsp://admin:Ju@192.168.1.30:554/Streaming/channels/201 
          roles:
            - record 
        - path: rtsp://admin:Ju@192.168.1.30:554/Streaming/channels/202
          roles:
            - detect
    motion:
      mask:   
        - 268,0,443,0,498,73,564,105,548,179,640,330,640,408
        - 260,230,32,109,270,0,332,0,403,103


    zones:
      zone_front_deck:
        coordinates: 0,480,0,74,347,27,398,81,466,106,541,177,640,336,640,480 
        objects:  
          - person
          - cat
          - dog
        filters:
          person:
            min_area: 1000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.6
          cat:
            min_area: 1000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.7
          dog:
            min_area: 1000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.7

  #  record:
  #    events:
   #     required_zones:
    #      - zone_front_deck
           

    detect:
      width: 640
      height: 480
      fps: 5 
    objects:
      track:
        - person
        - cat  
        - dog 

      filters:
        person:
          min_area: 1000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.7
        
        cat:
          min_area: 1000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.7
          
        dog:
          min_area: 1000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.7


    snapshots:
      enabled: true
      clean_copy: true
      timestamp: false
      crop: true
      quality: 100
      retain:
        default: 20
        objects:
          person: 30
 
############################################################################################################################################################### 
 
  back_shed:
    ui:
      order: 3
    ffmpeg:
      inputs:
        - path: rtsp://admin:Ju@192.168.1.30:554/Streaming/channels/301
          roles:
            - record 
        - path: rtsp://admin:Ju@192.168.1.30:554/Streaming/channels/302
          roles:
            - detect         
    
    motion:
      mask:    
        - 0,480,274,480,165,357,65,288,0,315
        - 589,210,600,102,517,93,500,187
        - 0,0,228,0,365,0,423,41,0,168                        
    detect:
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
        - cat   
        - dog 

      filters:
        person:
          min_area: 1000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.6
        
        cat:
          min_area: 1000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.7
          
        dog:
          min_area: 1000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.7

    snapshots:
      enabled: true
      clean_copy: true
      timestamp: false
      crop: true
      quality: 100
      retain:
        default: 20
        objects:
          person: 30
##########################################################################################################################################################          
  sand_pit:
    ui:
      order: 4  
    ffmpeg:
      inputs:
        - path: rtsp://admin:Ju@192.168.1.30:554/Streaming/channels/401
          roles:
            - record
        - path: rtsp://admin:Ju@192.168.1.30:554/Streaming/channels/402
          roles:  
            - detect
    motion:
      mask:    
        - 640,0,640,480,536,480,289,256,239,139,247,0
        - 96,263,214,480,0,480,0,146,210,107,243,252

    zones:
      zone_sand_pit:
        coordinates: 0,146,147,127,145,161,218,157,230,98,294,107,640,351,640,480,0,480
        objects:  
          - person
          - cat
          - dog
        filters:
          person:
            min_area: 1000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.6 
          cat:
            min_area: 1000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.7
          dog:
            min_area: 1000
            max_area: 100000
            min_ratio: 0.5
            max_ratio: 2.0
            min_score: 0.5
            threshold: 0.7

 #   record:
    #  events:
    #    required_zones:
     #     - zone_sand_pit

    detect:
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
        - cat  
        - dog 

      filters:
        person:
          min_area: 1000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.5
        
        cat:
          min_area: 1000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.5
          
        dog:
          min_area: 1000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.5


    snapshots:
      enabled: true
      clean_copy: true
      timestamp: false
      crop: true
      quality: 100
      retain:
        default: 20
        objects:
          person: 30
    
###########################################################################################################################          

  360cam:
    ui:
      order: 5
    ffmpeg:
      inputs:
        - path: rtsp://admin:Ju@192.168.1.66:554/MediaInput/h264
          roles:
            - record     
            - detect
    motion:
      mask:    
        - 1568,261,1267,181,1268,69,1064,0,1920,0,1920,251
        - 0,546,1544,535,1475,694,978,736,0,794 
    #zones:  
    #  zone_360_nextdoor:
    #    coordinates: 
   #       - 1563,270,1262,189,1264,68,1087,23,1103,0,1920,0,1920,260     
   #       - 158,758,307,690,303,546,0,543,0,796                        
    detect:
      width: 1920
      height: 1080
      fps: 5
    objects:
      track:
        - person  
        - cat
        - dog

      filters:
        person:
          min_area: 2000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.5
        
        cat:
          min_area: 1000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.5
          
        dog:
          min_area: 1000
          max_area: 100000
          min_ratio: 0.5
          max_ratio: 2.0
          min_score: 0.5
          threshold: 0.5


    snapshots:
      enabled: true
      clean_copy: true
      timestamp: false
      crop: true
      retain:
        default: 20
        objects:
          person: 30
      
 #####################################################################################################################################         
#testing
#####################################################################################################################################                     

           
          

Relevant log output

2023-10-23 17:05:48.190828891  [INFO] Starting Frigate...
2023-10-23 17:05:48.914482003  [2023-10-23 17:05:48] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-10-23 17:05:48.978610495  [2023-10-23 17:05:48] peewee_migrate                 INFO    : Starting migrations
2023-10-23 17:05:48.981332908  [2023-10-23 17:05:48] peewee_migrate                 INFO    : There is nothing to migrate
2023-10-23 17:05:48.992300550  [2023-10-23 17:05:48] detector.cpu                   INFO    : Starting detection process: 436
2023-10-23 17:05:48.993506749  [2023-10-23 17:05:48] frigate.app                    INFO    : Output process started: 438
2023-10-23 17:05:48.994011538  [2023-10-23 17:05:48] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-10-23 17:05:49.001450421  [2023-10-23 17:05:48] frigate.app                    INFO    : Camera processor started for driveway_cam: 441
2023-10-23 17:05:49.001504769  [2023-10-23 17:05:49] frigate.app                    INFO    : Camera processor started for front_entry: 443
2023-10-23 17:05:49.009693012  [2023-10-23 17:05:49] frigate.app                    INFO    : Camera processor started for front_deck: 444
2023-10-23 17:05:49.009790214  [2023-10-23 17:05:49] frigate.app                    INFO    : Camera processor started for back_shed: 446
2023-10-23 17:05:49.013586252  [2023-10-23 17:05:49] frigate.app                    INFO    : Camera processor started for sand_pit: 447
2023-10-23 17:05:49.017633329  [2023-10-23 17:05:49] frigate.app                    INFO    : Camera processor started for 360cam: 449
2023-10-23 17:05:49.021312081  [2023-10-23 17:05:49] frigate.app                    INFO    : Capture process started for driveway_cam: 450
2023-10-23 17:05:49.025855421  [2023-10-23 17:05:49] frigate.app                    INFO    : Capture process started for front_entry: 454
2023-10-23 17:05:49.030197900  [2023-10-23 17:05:49] frigate.app                    INFO    : Capture process started for front_deck: 458
2023-10-23 17:05:49.041366253  [2023-10-23 17:05:49] frigate.app                    INFO    : Capture process started for back_shed: 463
2023-10-23 17:05:49.041370990  [2023-10-23 17:05:49] frigate.app                    INFO    : Capture process started for sand_pit: 469
2023-10-23 17:05:49.047646119  [2023-10-23 17:05:49] frigate.app                    INFO    : Capture process started for 360cam: 476

FFprobe output from your camera

[{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"15/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","display_aspect_ratio":"16:9","height":2160,"width":3840}]}},{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"15/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","display_aspect_ratio":"4:3","height":480,"width":640}]}}]

Frigate stats

{"return_code":0,"stderr":"","stdout":"vainfo:VA-APIversion:1.17(libva2.10.0)nvainfo:Driverversion:InteliHDdriverforIntel(R)GenGraphics-23.1.1()nvainfo:SupportedprofileandentrypointsnVAProfileNone:tVAEntrypointVideoProcnVAProfileNone:tVAEntrypointStatsnVAProfileMPEG2Simple:tVAEntrypointVLDnVAProfileMPEG2Simple:tVAEntrypointEncSlicenVAProfileMPEG2Main:tVAEntrypointVLDnVAProfileMPEG2Main:tVAEntrypointEncSlicenVAProfileH264Main:tVAEntrypointVLDnVAProfileH264Main:tVAEntrypointEncSlicenVAProfileH264Main:tVAEntrypointFEInVAProfileH264Main:tVAEntrypointEncSliceLPnVAProfileH264High:tVAEntrypointVLDnVAProfileH264High:tVAEntrypointEncSlicenVAProfileH264High:tVAEntrypointFEInVAProfileH264High:tVAEntrypointEncSliceLPnVAProfileVC1Simple:tVAEntrypointVLDnVAProfileVC1Main:tVAEntrypointVLDnVAProfileVC1Advanced:tVAEntrypointVLDnVAProfileJPEGBaseline:tVAEntrypointVLDnVAProfileJPEGBaseline:tVAEntrypointEncPicturenVAProfileH264ConstrainedBaseline:tVAEntrypointVLDnVAProfileH264ConstrainedBaseline:tVAEntrypointEncSlicenVAProfileH264ConstrainedBaseline:tVAEntrypointFEInVAProfileH264ConstrainedBaseline:tVAEntrypointEncSliceLPnVAProfileVP8Version0_3:tVAEntrypointVLDnVAProfileVP8Version0_3:tVAEntrypointEncSlicenVAProfileHEVCMain:tVAEntrypointVLDnVAProfileHEVCMain:tVAEntrypointEncSlicenVAProfileHEVCMain:tVAEntrypointFEInVAProfileHEVCMain10:tVAEntrypointVLDnVAProfileHEVCMain10:tVAEntrypointEncSlicenVAProfileVP9Profile0:tVAEntrypointVLDnVAProfileVP9Profile2:tVAEntrypointVLD"}

Operating system

Other Linux

Install method

Docker Compose

Coral version

Other

Network connection

Wired

Camera make and model

Hikvision Panasonic 360 and dahua

Any other information that may be helpful

Screenshot_20231023-172423

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Comments: 15

Most upvoted comments

looks good and much lower CPU usage. Feel free to create a new issue if something else comes up

You just need to setup detection on gpu, you have not done that

You should simply use hwaccel_args: preset-nvidia-h264