eroji / rtsp2mjpg

RTSP to MJPEG stream conversion using FFmpeg and FFserver
99 stars 41 forks source link

Use less resources while idle? #27

Open epheterson opened 2 years ago

epheterson commented 2 years ago

Is it possible for this docker container to react to the need for a stream instead of always being available, and maintain it for a period of time after the last request then stop again? It's my only docker container that has a constant relatively-high CPU usage of 7-9%.

I do like how responsive the stream is and how little latency is added due to the conversion, so I wouldn't want it to come at the cost of losing those benefits, but perhaps it could ramp up when needed, maintain for 30m or so after the last request, then shut down until a new request comes in. Not sure how complicated that would be to implement but would save a lot of resources.

For context, I'm using this with OctoPrint, so I want it responsive while a print is going on (which is pretty rare) and idle otherwise.

epheterson commented 2 years ago

This project implements streaming only when requested, can yours do the same? Yours is much simpler to implement.

https://github.com/Roverr/rtsp-stream