hassio-addons / addon-motioneye

motionEye - Home Assistant Community Add-ons
https://addons.community
MIT License
266 stars 43 forks source link

Disable disconnecting idle MJPEG clients #470

Closed roelvdwater closed 2 months ago

roelvdwater commented 3 months ago

Proposed Changes

With this change, the mjpg_client_idle_timeout is set to 0. This ensures that MPJEG clients are not automatically disconnected. When this is set to the default value of 10, 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 the camera.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.

roelvdwater commented 3 months ago

@frenck Do you mind taking a look at this PR? Tagging you as I don't know if you get notified about new PRs and/or haven't seen it.

github-actions[bot] commented 2 months ago

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.