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

Add idle timeout #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add idle timeout #26

wants to merge 2 commits into from

Conversation

Kartoffel
Copy link

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

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
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