Disable disconnecting idle MJPEG clients #470
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
With this change, the
mjpg_client_idle_timeout
is set to0
. This ensures that MPJEG clients are not automatically disconnected. When this is set to the default value of10
, snapshots cannot be made.I am using the official motionEye integration, which presumably calls the
picture/1/current/
endpoint. However, as motionEye disconnects clients after 10 seconds, this always results in an empty image when taking a snapshot using thecamera.snaphot
service.I have been running the latest version of motionEye on a Raspberry Pi for a while (outside of Home Assistant) and have applied the same fix there, as otherwise it's impossible to create snapshots. This has been running fine for at least half a year now. Applying the same fix here as well allows me to use this add-on as well and deprecate my dedicated motionEye instance running on that Raspberry Pi.
Also, when this
mjpg_client_idle_timeout
is not disabled, the camera stream seems to freeze the entire browser (Firefox) randomly sometimes, whereas I don't have this issue with motionEye running on the Raspberry Pi.Edit: It seems like I don't have permissions to add labels and it results in the build failing. I'd like to add the
bugfix
label.