[Bug]: On demand started FFMPEG processes are not terminated after usage #15289
-
Checklist
Describe the problem you are havingIf a camera is viewed or detects motion and therefor is streamed to the overview display an additional ffmpeg process is started in my setup to vacilitate the transcoding from h265 from my reolink camera to a h264 stream via go2rtc. The video is streamed correctly but after viewing the FFMPEG process keeps running according to "intel_gpu_top". Visiting the camera again spawns another process. So after some visits to streaming cams the GPU is overwhelmed. I would kindly suggest to consider this behaviour as a bug as it uses valuable system resources, basicly forever. Steps to reproduce
Versionghcr.io/blakeblackshear/frigate:0.15.0-beta2 In which browser(s) are you experiencing the issue with?Firefox 133.0 (aarch64) , Chrome Version 131.0.6778.86 (Official Build) (arm64) Frigate config filemqtt:
enabled: false
ffmpeg:
hwaccel_args: preset-vaapi
objects:
track:
- person
- bird
- cat
- dog
database:
path: /db/frigate.db
go2rtc:
streams:
trackmix_wide:
- rtsp://user:password@camera-ip:554/h264Preview_01_main
- ffmpeg:trackmix_wide#video=h264#audio=opus#hardware
trackmix_zoom:
- rtsp://user:password@camera-ip:554/h264Preview_02_main
- ffmpeg:trackmix_zoom#video=h264#audio=opus#hardware
doorbell:
- rtsp://user:password@camera-ip:554/cam/realmonitor?channel=1&subtype=0
webrtc:
candidates:
- local-ip:8555
- stun:8555
cameras:
doorbell:
enabled: true
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path:
rtsp://user:password@camera-ip:554/cam/realmonitor?channel=1&subtype=0
input_args: preset-rtsp-restream
roles:
- record
- path:
rtsp://user:password@camera-ip:554/cam/realmonitor?channel=1&subtype=1
roles:
- detect
detect:
enabled: true
width: 800
height: 480
fps: 5
zones:
nearDoor:
coordinates: 0.723,0.489,1,0.459,1,1,0.703,1
loitering_time: 0
inertia: 3
review:
alerts:
required_zones: nearDoor
motion:
threshold: 50
contour_area: 10
improve_contrast: 'true'
trackmix_wide:
enabled: true
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://user:password@camera-ip:554/h264Preview_01_main
input_args: preset-rtsp-restream
roles:
- record
- path: rtsp://user:password@camera-ip:554/h264Preview_01_sub
roles:
- detect
detect:
enabled: true
width: 896
height: 512
fps: 6
onvif:
host: camera-ip
port: 8000
user: user
password: password
motion:
mask:
- 0.669,1,0.617,0.714,0.825,0.401,0.999,0.402,0.996,0.991
- 1,0.217,0.635,0.138,0.345,0.144,0.099,0.17,-0.001,0.272,0,0,0.999,0
threshold: 30
contour_area: 10
improve_contrast: 'true'
objects:
mask: 0.749,0.967,0.682,0. docker-compose file or Docker CLI commandversion: "3.9"
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:0.15.0-beta2
shm_size: "512mb" # update for your cameras based on calculation above
devices:
- /dev/bus/usb:/dev/bus/usb # Passes the USB Coral, modify if needed
volumes:
- /etc/localtime:/etc/localtime:ro
- /path/to/config:/config # Update to your desired config path
- /path/to/storage:/media/frigate # Update for media storage
- /path/to/db:/db/ # Update for database storage
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 2G
ports:
- "8971:8971"
# - "5000:5000" # Internal unauthenticated access. Expose carefully.
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
- "1984:1984/tcp" # go2rtc internal (for debug)
environment:
FRIGATE_RTSP_PASSWORD: "your_password_here"
ulimits:
nofile:
soft: 65535
hard: 65535 Relevant Frigate log output(Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0" "-"
2024-12-01 14:03:03.428911069 192.168.178.194 - - [01/Dec/2024:14:03:03 +0000] "GET /api/trackmix_zoom/latest.webp?height=370&cache=1733061783396 HTTP/1.1" 200 3808 "https://192.168.178.174:8971/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0" "-"
2024-12-01 14:03:03.901929779 14:03:03.901 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error=EOF url=ffmpeg:trackmix_zoom#video=h264#audio=opus#hardware
2024-12-01 14:03:04.449832900 [2024-12-01 14:03:04] frigate.record.maintainer DEBUG : Found 1 old frames.
2024-12-01 14:03:04.821417709 [2024-12-01 14:03:04] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2024-12-01/14/doorbell/02.54.mp4 in 0.32727503776550293 seconds.
2024-12-01 14:03:04.979313795 [2024-12-01 14:03:04] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2024-12-01/14/trackmix_wide/02.53.mp4 in 0.5140228271484375 seconds.
2024-12-01 14:03:07.772839000 14:03:07.772 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error=EOF url=ffmpeg:trackmix_zoom#video=h264#audio=opus#hardware
2024-12-01 14:03:09.452845060 [2024-12-01 14:03:09] frigate.record.maintainer DEBUG : Found 2 old frames.
2024-12-01 14:03:09.685738093 [2024-12-01 14:03:09] frigate.record.maintainer DEBUG : Copied /media/frigate/recordings/2024-12-01/14/trackmix_zoom/02.44.mp4 in 0.22771096229553223 seconds.
2024-12-01 14:03:11.531104642 14:03:11.530 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error=EOF url=ffmpeg:trackmix_zoom#video=h264#audio=opus#hardware
2024-12-01 14:03:11.905355485 192.168.178.194 - - [01/Dec/2024:14:03:11 +0000] "GET /api/trackmix_wide/latest.webp?height=370&cache=1733061791847 HTTP/1.1" 200 42974 "https://192.168.178.174:8971/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0" "-" Relevant go2rtc log output2024-12-01 15:03:04.240718628 [INFO] Preparing new go2rtc config...
2024-12-01 15:03:04.580028890 [INFO] Not injecting WebRTC candidates into go2rtc config as it has been set manually
2024-12-01 15:03:04.616165888 [INFO] Starting go2rtc...
2024-12-01 15:03:04.688507305 15:03:04.688 INF go2rtc platform=linux/amd64 revision=b2399f3 version=1.9.2
2024-12-01 15:03:04.688510932 15:03:04.688 INF config path=/dev/shm/go2rtc.yaml
2024-12-01 15:03:04.688869935 15:03:04.688 INF [rtsp] listen addr=:8554
2024-12-01 15:03:04.689108196 15:03:04.688 INF [api] listen addr=:1984
2024-12-01 15:03:04.689185315 15:03:04.689 INF [webrtc] listen addr=:8555
2024-12-01 15:03:14.243448818 [INFO] Starting go2rtc healthcheck service...
2024-12-01 15:03:44.447663712 15:03:44.447 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error=EOF url=ffmpeg:trackmix_wide#video=h264#audio=opus#hardware Operating systemOther Linux Install methodDocker Compose Network connectionWired Camera make and modelReolink Trackmix POE Screenshots of the Frigate UI's System metrics pagesAny other information that may be helpfulNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This would be a go2rtc bug not a frigate bug |
Beta Was this translation helpful? Give feedback.
-
Updated from
to
With that i could not replicate the issue above. I would consider this bug to be fixed with the go2rtc update. Sidenote. REOLINK RTSP implementation is bad. The amount of
is eyewatering. Buyers beware. |
Beta Was this translation helpful? Give feedback.
You can try using a newer version of go2rtc and see if that fixes it