-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate ffmpeg processes starting for sources #894
Comments
Tested and the issue remains in |
That's a powerful config, by the way. |
Testament to the power of go2rtc. It all "just works", and doesn't cripple the server doing it. This is how I get yt-dlp (inside frigate... but same for pure go2rtc)... frigate:
<<: *default-opts
privileged: true
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:0.13.2
# sysctls:
# - net.ipv6.conf.all.disable_ipv6=0
shm_size: "4096mb"
cap_add:
- CAP_PERFMON
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
limits:
cpus: "6.00"
memory: 12G
restart_policy:
condition: unless-stopped
delay: 5s
mem_limit: 12G
ulimits:
memlock:
soft: -1
hard: -1
entrypoint: /bin/sh -c "if ! [ -x /usr/local/bin/yt-dlp ]; then curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && chmod a+rx /usr/local/bin/yt-dlp || echo 'yt-dlp download failed'; fi && exec /init"
environment:
- TZ=Australia/Sydney
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- NVIDIA_REQUIRE_CUDA=cuda>=12.0
- FRIGATE_MQTT_HOST
- FRIGATE_MQTT_USER
- FRIGATE_MQTT_PASSWORD
- FRIGATE_RTSP_USER
- FRIGATE_RTSP_PASSWORD
- CAMERA_RTSP_USER
- CAMERA_RTSP_PASSWORD
- INTERCOM_RTSP_USER
- INTERCOM_RTSP_PASSWORD
- BUILDINGNVR_RTSP_USER
- BUILDINGNVR_RTSP_PASSWORD
- PLUS_API_KEY
devices:
- /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
- /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
- /dev/dri/renderD129 # for intel hwaccel, needs to be updated for your hardware
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/data/frigate/config:/config:rw"
- "camera-security:/media/frigate-dropbox"
- "camera-webcam:/media/webcam"
- "/data/frigate/media:/media/frigate:rw"
- type: tmpfs
target: /tmp/cache
tmpfs:
size: 2GB
network_mode: host |
I hope this will be fixed with killing any exec/rtsp process on stream stop. |
Versions Impacted:
1.8.4
as bundled with frigate ghcr.io/blakeblackshear/frigate1.8.5
downloaded from releasesFor some reason, on restart of frigate (and thus restart of go2rtc), some cameras are getting multiple ffmpeg processes started for them.
SIGHUP
'ing the processes makes them go away, but for a little while after restarting, go2rtc will keep creating more and more processes. Typically 8 - but not always.An example of relevant processes is below. In this example, the
livingptz.security
camera has multiple ffmpeg processes all publishing to7c80f440f9ccc4ac8b1073e541a1e9d2
(I've changed all the publish tokens for security, but retained the uniqueness and grouping)
I'm using the script (linked below) to clean up the multiple processes, and after some time - everything seems to settle down. New processes stop getting created and everything continues as it should.
https://gist.github.com/troykelly/a23ca304be5cd52961544673ba67a1e0
During the multiple ffmpeg process phase after restart, everything does appear to be working correctly - The only reason I am aware is because the multiple instances for each camera is causing the encoder on the GPU to max out.
Config
The text was updated successfully, but these errors were encountered: