Skip to content
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

Restreamer stream reliability with Nginx Proxy Manager and Rpi4 1GB #867

Open
foilandwater opened this issue Dec 31, 2024 · 2 comments
Open

Comments

@foilandwater
Copy link

Subject of the issue
Restreamer is not providing a reliable stream on a Rpi4 / 1GB ram.

Your environment
I have set up Restreamer 2 (v16.16) running on a Rpi4b with 1gb of ram with bookworm. It is running via a docker container using the following script:

sudo docker run --detach --restart always --name restreamer --privileged --publish 8080:8080 -v /mnt/restreamer/db:/restreamer/db datarhei/restreamer:rpi-latest

Using my Mac (same LAN) I can access the UI via a web browser so I have added the rtsp:// stream of a local hikvision camera that is providing a 1920x1080 stream. I have added the stream successfully and restreamer shows a working preview, with the usage in the corner showing 0-10% CPU and 4-050% MEM. The stream in the preview window stops and starts so it is half working. At moments I can access the generated HLS and player.html stream locally, but it's mostly not usable. When I try access these links from a computer or a phone on the same LAN, I see the preview but it doesn't show the stream.

The goal is to make this camera public. I already have a working subdomain which talks to nginx proxy manager (hosted on a VPS) which connects with the pi via SSL. All devices are on a Zerotier VPN so they are connected and working. The last step is to get the fundamental video stream working reliably on the LAN. Perhaps the Rpi4 with 1GB ram is not strong enough?

Worth mentioning is that when I initially installed Restreamer via docker, it loaded V6.8 which I believe is the much older Restreamer V1. This actually worked better - the stream worked for an hour before it started becoming unreliable.

Questions I have

  1. On a different site I am running a similar setup as above but on a Beelink AMD machine instead of a Rpi4. It is a lot more reliable, but I have had to restart it a few times. Is restreamer something that can provide public access to a private IP camera, 24/7 for long periods of time? Or am I expecting too much to begin with? Or is there a flag I can add to the docker script that keeps a feed fresh and functional for long periods of time?

  2. Should the Rpi4 / 1GB be able to handle what I'm throwing at it, or is the behaviour I'm experiencing to be expected and I should rather invest in better hardware?

Thanks,
Sean

@ioppermann
Copy link
Member

A rpi4 should be more than enough to stream a camera 24/7. Please also check your camera settings. It is importang to set a proper keyframe interval. Best for streaming is an interval of 2 seconds, or expressed in frames it should be double the framerate, eg. if your camera streams with 25 FPS the keyframe should be 50 frames.

@foilandwater
Copy link
Author

Thanks a lot for the reply and the info. The frame rate was set to 10 and the I Frame interval was set to 50. I have changed the frame rate from 10 to 25 and kept the I Frame the same. I will try and it revert.

Out of curiosity, I thought a lower frame rate would be easier to serve which is why I had lowered it form 25 to 10. What would be your thoughts on that? Which combination would restreamer be most happy with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants