Skip to content

Add idle timeout - #26

Open
Kartoffel wants to merge 2 commits into
OliverF:masterfrom
Kartoffel:idle_timeout
Open

Add idle timeout#26
Kartoffel wants to merge 2 commits into
OliverF:masterfrom
Kartoffel:idle_timeout

Conversation

@Kartoffel

Copy link
Copy Markdown

Add a -T flag to specify an optional idle timeout.

If no client connects for T seconds, mjpeg-streamer will disconnect from the source. When a new client connects, they will see a 'connecting' frame until the software connects to the source again.

Implements #3

@dermodmaster

Copy link
Copy Markdown

Very nice work!
There is one problem with the /snapshot route: after the server drops the source connection /snapshot will serve the last received image from source (which can be very old if nobody used /stream before) instead of establish a new connection and getting a fresh image.

@Kartoffel

Copy link
Copy Markdown
Author

Thank you. I could add a workaround so it connects and fetches a new frame, but there's no clear nice way to do this at the moment and it might take seconds to respond to a single request.
IMO it's better to check if the last frame is stale, and display a placeholder "not connected" image when a snapshot is requested and mjpeg-relay is not connected to the camera.
Does that suit your use case?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants