[HW Accel Support]: FFMPEG CPU usage #17992
-
Describe the problem you are havingI am having high ffmpeg cpu usage(21%) for one of my cameras(ReoLink RLC-811A). I have preset-nvidia in ffmpeg but i am not sure if its working or not. also is it possible to use the gpu to record? because in the system metrics gpu usage its currently just doing decode and no encoding edit: i also completely forgot to add but this camera is also having recording issue where its hitch, like it would smooth motion/fps then slows down then smooth again. Version0.15.0-6cb5cfb Frigate config filemqtt:
enabled: false
#~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o
detectors:
tensorrt:
type: tensorrt
device: 0 #This is the default, select the first GPU
#~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o
ffmpeg:
hwaccel_args: preset-nvidia
#~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o
model:
path: /config/model_cache/tensorrt/yolov7-320.trt
input_tensor: nchw
input_pixel_format: rgb
width: 320
height: 320
#~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o
go2rtc:
streams:
porch:
- rtsp://RTSP:[redacted]@192.168.2.193:554/h265Preview_01_main#audio=aac#video=h265#hardware
living_room:
- rtsp://RTSP:[redacted]@192.168.2.194:554/h265Preview_01_main#audio=aac#video=h265#hardware
#~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o
cameras:
front_porch: # <--- this will be changed to your actual camera later
enabled: true
ffmpeg:
output_args:
record: preset-record-generic-audio-aac
inputs:
- path: rtsp://127.0.0.1:8554/porch
roles:
- detect
- record
objects:
track:
- person
filters:
person:
# Optional: minimum width/height of the bounding box for the detected object (default: 0)
min_ratio: 0.5
# Optional: maximum width/height of the bounding box for the detected object (default: 24000000)
max_ratio: 2.0
# # Optional: minimum score for the object to initiate tracking (default: shown below)
# min_score: 0.6
# # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
# threshold: 0.65
mask:
- 0.148,0.178,0.156,0.175,0.166,0.18,0.186,0.214,0.194,0.218,0.219,0.213,0.228,0.203,0.227,0.177,0.221,0.156,0.213,0.15,0.21,0.131,0.214,0.104,0.211,0.071,0.189,0.07,0.16,0.07,0.148,0.091,0.149,0.146
- 0.564,0.124,0.541,0.339,0.647,0.378,0.668,0.14
record:
enabled: true
retain:
days: 0
mode: all
alerts:
retain:
days: 13
detections:
retain:
days: 13
detect:
enabled: true
motion:
mask:
- 2965,1171,2287,620,2390,193,2405,161,2429,145,2430,112,2554,123,2723,149,2944,203,3216,269,3563,367,3840,487,3840,1430,3840,1739
#~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o~~o
living_room: # <--- this will be changed to your actual camera later
enabled: true
ffmpeg:
output_args:
record: preset-record-generic-audio-aac
inputs:
- path: rtsp://127.0.0.1:8554/living_room
roles:
- detect
- record
objects:
track:
- person
filters:
person:
# Optional: minimum width/height of the bounding box for the detected object (default: 0)
min_ratio: 0.5
# Optional: maximum width/height of the bounding box for the detected object (default: 24000000)
max_ratio: 2.0
# Optional: minimum score for the object to initiate tracking (default: shown below)
# min_score: 0.6
# # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
# threshold: 0.65
mask:
- 917,834,1385,1078,1409,492,921,422
- 554,490,832,465,792,153,544,193
record:
enabled: true
retain:
days: 0
mode: all
alerts:
retain:
days: 13
detections:
retain:
days: 13
detect:
enabled: true
motion:
mask:
- 515,0,530,409,548,414,585,410,655,402,704,471,844,456,812,0
version: 0.15-1 docker-compose file or Docker CLI commanddocker run
-d
--name='frigate'
--net='bridge'
--pids-limit 2048
-e TZ="America/New_York"
-e HOST_OS="Unraid"
-e HOST_HOSTNAME="Fuana"
-e HOST_CONTAINERNAME="frigate"
-e 'FRIGATE_RTSP_PASSWORD'='[redacted]'
-e 'PLUS_API_KEY'=''
-e 'NVIDIA_VISIBLE_DEVICES'='0'
-e 'NVIDIA_DRIVER_CAPABILITIES'='compute,utility,video'
-e 'YOLO_MODELS'='yolov4-416,yolov4-tiny-416,yolov7-320,yolov7x-320'
-e 'USE_FP16'='false'
-e 'TRT_MODEL_PREP_DEVICE'='0'
-l net.unraid.docker.managed=dockerman
-l net.unraid.docker.webui='http://[IP]:[PORT:8971]'
-l net.unraid.docker.icon='https://raw.githubusercontent.com/yayitazale/unraid-templates/main/frigate.png'
-p '5000:5000/tcp'
-p '8554:8554/tcp'
-p '8555:8555/tcp'
-p '8555:8555/udp'
-p '1984:1984/tcp'
-p '8971:8971/tcp'
-v '/mnt/user/appdata/frigate_config/config':'/config':'rw'
-v '/mnt/user/Disk3/frigate_storage/storage':'/media/frigate':'rw'
-v '/etc/localtime':'/etc/localtime':'rw'
--runtime=nvidia
--gpus=all
--shm-size=5126mb
--mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000
--restart unless-stopped 'ghcr.io/blakeblackshear/frigate:stable-tensorrt' Relevant Frigate log outputN/A Relevant go2rtc log outputN/A FFprobe output from your cameraInput #0, rtsp, from 'rtsp://RTSP:[redacted]@192.168.2.194:554/h265Preview_01_main':
Metadata:
title : Session streamed by "preview"
Duration: N/A, start: 0.000063, bitrate: N/A
Stream #0:0: Video: hevc (Main), yuv420p(tv), 2560x1920, 30 fps, 30 tbr, 90k tbn
Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp
Input #0, rtsp, from 'rtsp://127.0.0.1:8554/porch':
Metadata:
title : go2rtc/1.9.2
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: hevc (Main), yuv420p(tv), 3840x2160, 25 fps, 25 tbr, 90k tbn
Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp Install methodDocker CLI Object DetectorTensorRT Network connectionWired Camera make and modelReoLink RLC-811A Screenshots of the Frigate UI's System metrics pagesAny other information that may be helpfulCPU: ryzen 7 2700 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
you're running recording on the full res stream, so this is expected. You will either want to use a sub stream, or at least use the detect config to reduce the stream down to 1280x720 or similar. |
Beta Was this translation helpful? Give feedback.
Frigate only copies and does not decode the
record
stream, so there's no need for hardware acceleration in that case.