RTSP/RTMP proxy/server to offload the cameras #1623
Replies: 9 comments 21 replies
-
I'm planning to bake this into frigate directly in place of the existing RTMP restreaming implemented in nginx. |
Beta Was this translation helpful? Give feedback.
-
THIS IS GREAT! |
Beta Was this translation helpful? Give feedback.
-
Shouldn't there need to be some sort of security on the secondary rtsp(:8554) stream? Since you've already auth'd to the camera via simple-server tool, doesn't that make the camera streams completely visible to any IP on that network? |
Beta Was this translation helpful? Give feedback.
-
Question... |
Beta Was this translation helpful? Give feedback.
-
How do you add it back to HA ? HA Generic platform requires a still_image_url which rtsp-simple-server does not provide. |
Beta Was this translation helpful? Give feedback.
-
TLDR for anyone with reolink cams and stream stability issues, I highly recommend rtsp-simple-server as @tubalainen mentioned. #gamechanger! I have 5 Reolink cameras and have tried all manner of RTSP/RTMP/HTTP/neolink to integrate them into a frigate and maintain a "stable" connection. I was almost to the point of just throwing in the towel and replacing a few of my more critical cams with another brand, but rtsp-simple-server has changed the game for me. I run frigate on a separate RPi4 and have rtsp-simple-server running on a separate larger, more powerful host. I haven't moved rtsp-simple-server onto the frigate RPi4 yet as its currently using ~40% of one core on an intel 6132 CPU. I'm not sure yet if my RPI4 is going to be capable of running both frigate AND rtsp-simple-server with 10 streams (5640x480 detect streams, and 55MP record streams). My rtsp-simple server has been running now for 13 days without a restart, and frigate almost as long, as I only restarted it recently to upgrade to 0.91. So far, I haven't had a single detect or record stream get stuck to the point that I've had to restart either component, which I was doing every couple of days before. The rtsp-simple-server does restart streams from time to time, but frigate (and Home Assistant) seem to be able to handle the restart MUCH more gracefully than when frigate was talking directly to the cams. Looking forward to what @blakeblackshear has been mentioning around a more robust relay inside Frigate to hopefully eliminate the need for a separate rtsp-simple-server. |
Beta Was this translation helpful? Give feedback.
-
I know it's kind of OT, but after two weeks of switching between RTMP and HTTP streams on my 520A's with the 31 Aug beta firmware, both are great: stable streams and fluent recordings. So I'd encourage everyone with Reolink's to contact support to explain what you're seeing and ask if they are working on it - and hopefully they get the message and provide better firmware for all models! (Especially as they still sell them all) Frigate has crashed a few times with Python errors, but without anything to reference I don't know if this is a Frigate thing or a Reolink thing?? I'm still running 0.8.4. These are the relevant configs for reference- 0.8.4 HTTP config
ffmpeg:
hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p
input_args: -avoid_negative_ts make_zero -fflags nobuffer+genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000
cameras:
Driveway:
ffmpeg:
inputs:
- path: http:https://192.168.1.71/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
roles:
- detect
- path: http:https://192.168.1.71/flv?port=1935&app=bcs&stream=channel0_main.bcs&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
roles:
- clips
output_args:
clips: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy # -an
width: 896
height: 672
fps: 5 0.8.4 RTMP config
ffmpeg:
hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p
input_args: -fflags nobuffer -flags low_delay -strict experimental -rw_timeout 5000000 -f live_flv
cameras:
Driveway:
ffmpeg:
inputs:
- path: rtmp:https://192.168.1.71/bcs/channel0_ext.bcs?channel=0&stream=2&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
roles:
- detect
- path: rtmp:https://192.168.1.71/bcs/channel0_main.bcs?channel=1&stream=0&user={FRIGATE_USER}&password={FRIGATE_PASSWORD}
roles:
- clips
output_args:
clips: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy # -an
width: 896
height: 672
fps: 5 |
Beta Was this translation helpful? Give feedback.
-
With the new 0.11-beta out i'm having huge issues with the rtsp-server... The RTMP streams is non working... |
Beta Was this translation helpful? Give feedback.
-
It's 2022 and I would like to say that go2rtc has replaced simple-rtsp-server for me, for good! |
Beta Was this translation helpful? Give feedback.
-
This has been a blessing for me, my cameras started to act weird because I had too many active RTSP / RTMP clients connected to each camera (like more than 3-4 connections).
I just started using this tool to offload the cameras and it has been working wonders for frame drops and strange artefacts in general.
https://github.com/aler9/rtsp-simple-server
Here is my (simple) yaml config for the tool:
I use this docker creation string:
docker run -d --network=host --name="rtsp-server" -v /usr/share/dockers/rtsp-server/conf.yml:/rtsp-simple-server.yml aler9/rtsp-simple-server
Then from like frigate just use this RTSP URL (for cam1_ch1 in this example)
Hope it can help others :)
Beta Was this translation helpful? Give feedback.
All reactions