datarhei / restreamer

The Restreamer is a complete streaming server solution for self-hosting. It has a visually appealing user interface and no ongoing license costs. Upload your live stream to YouTube, Twitch, Facebook, Vimeo, or other streaming solutions like Wowza. Receive video data from OBS and publish it with the RTMP and SRT server.
https://docs.datarhei.com/restreamer/
Apache License 2.0
3.78k stars 436 forks source link

very slow restream #591

Open pdnovo opened 1 year ago

pdnovo commented 1 year ago

Subject of the issue I've a Raspberry Pi 400 that I want to use to restroom a rtsp feed to a browser compatible format.

Your environment I've installed the Pi OS Lite 64 bit, docker and Datarghei restreamer V2

Files Report attached

Expected behavior To restroom the rtsp feed from my IP camera (an OEM Hikvidion) so that is usable in a browser. The rtsp stream itself has a latency of ± 1 second, that's fine for my application.

Actual behavior The latency of the restream is about 20 to 25 seconds and that is not acceptable for this application. The CPU is load is <3% and memory is 7%

report.txt

svenerbeck commented 1 year ago

Hello @pdnovo

Thank you for providing detailed information about your setup and your issue.

The behavior you're observing with the 20 to 25-second latency is consistent with the inherent latency of HLS streaming. HLS (HTTP Live Streaming) segments video into chunks, typically of several seconds each, naturally introducing a delay. Considering the nature of HLS, a latency within the range of 20 to 25 seconds is expected. Although the original RTSP feed from your IP camera has a latency of around 1 second, the conversion process to a browser-compatible format like HLS will introduce additional latency.

If reducing this latency is critical for your application, you should explore other streaming protocols or methods that offer lower latencies. However, these might come with compatibility, quality, or reliability trade-offs. I hope this clarifies the situation. If you have any more questions or concerns, please don't hesitate to let us know.

Cheerio, Sven