Open atx32 opened 4 weeks ago
Have you tried with single camera?
I don't know why you have progressive launch time. Maybe it's just a coincidence. There may be a heavy load on the network.
Also Reonlik cameras has awful RTSP realisation.
FFmpeg start time depends on cameras keyframe interval. On good cameras it's 1 second. I don't know this value on Reolink.
Also you can try two source version:
streams:
camera1:
- rtsp:// # for reolink better to use http
- ffmpeg:camera1#audio=opus
This version doesn't depend on keyframe interval and should starts almost instantly.
Network isn't loaded so that should not be an issue. I will experiment with the items you suggest and report back.
The keyframe interval is one part of the issue as the default interval for the Reolink low-res stream is 4 sec. I set it lower (2 of the 3 cameras support changing the keyframe interval) and everything loads in under 10 sec. I still see the progressive launch times; they are just shorter now. I will spend some more time trying various settings, but it may be a week or 2 before I get to it.
It would be good to note the keyframe interval dependency in the docs.
I'm using the go2rtc HA add-on with the RTSPtoWebRTC integration all running on a RPi4. 3 of 4 cameras need transcoding to have a WebRTC compliant audio stream, so settings are configured as:
When viewing my dashboard that has all the camera feeds, most times one of the three that are transcoded will fail to start. The error shown from the integration is "Failed to start WebRTC stream: Timeout talking to RTSPtoWebRTC server". The integration has a 10 sec timeout for the stream to start, and in the go2rtc logs I see that one ffmpeg instance will take more than 10 sec to start.
Occasionally all three will start in less than 10 sec, and then all streams work with no error. I never see high CPU usage and latency is low once the streams start so I don't think this is specifically due to the RPi4.
Since all three ffmpeg instances are called at the same time, why do they take progressively longer to start and is there any way to improve this?