roflcoopter / viseron

Self-hosted, local only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor.
MIT License
1.5k stars 154 forks source link

[FR] static_mjpeg_streams timeout #148

Open JustMe0815 opened 3 years ago

JustMe0815 commented 3 years ago

Feature request:

make static_mjpeg_streams timeout/restart after config set time. Most clients do not properly close connection when exiting and stream will stay open and blocking new connections even when nothing is listening.

roflcoopter commented 3 years ago

What kind of client are you talking about? Would be good for me if i could replicate the issue to make a good solution

JustMe0815 commented 3 years ago

you could just use chrome to replicate it. instead of closing the tab just put in another cam in the url and it stays open.

I also used android app called "tinyCam Free" which had the same issue.

roflcoopter commented 3 years ago

Hmm im not seeing this behaviour, here i first opened the static stream called my-stream, then i changed URL to go to the mjpeg-stream

[2021-04-09 12:59:12] [viseron.data_stream     ] [DEBUG   ] - Subscribing to data topic static_mjepg_streams/uteplats/my-stream, <Queue maxsize=10>
[2021-04-09 12:59:12] [viseron.webserver.stream_handler] [DEBUG   ] - Stream my-stream is not active, starting
[2021-04-09 12:59:12] [viseron.data_stream     ] [DEBUG   ] - Subscribing to data topic uteplats/frame/processed/*, <Queue maxsize=10>
[2021-04-09 12:59:42] [viseron.webserver.stream_handler] [DEBUG   ] - {}
[2021-04-09 12:59:42] [viseron.webserver.stream_handler] [DEBUG   ] - {'draw_motion_mask': False, 'height': 0, 'draw_motion': False, 'rotate': 0, 'mirror': False, 'draw_objects': False, 'width': 0, 'draw_zones': False}
[2021-04-09 12:59:42] [viseron.data_stream     ] [DEBUG   ] - Subscribing to data topic uteplats/frame/processed/*, <Queue maxsize=10>
[2021-04-09 12:59:43] [viseron.data_stream     ] [DEBUG   ] - Unsubscribing from data topic static_mjepg_streams/uteplats/my-stream, 8d109659-0cca-4200-b7ab-f6d7a0dfd538
[2021-04-09 12:59:43] [viseron.webserver.stream_handler] [DEBUG   ] - Stream my-stream closed for camera uteplats
[2021-04-09 12:59:44] [viseron.data_stream     ] [DEBUG   ] - Unsubscribing from data topic uteplats/frame/processed/*, 7a5c1cdd-4ae6-4261-a86a-7be7b652df0c
[2021-04-09 12:59:44] [viseron.webserver.stream_handler] [DEBUG   ] - Closing stream my-stream