gilestrolab / ethoscope

a platform from monitoring animal behaviour in real time from a raspberry pi
http://lab.gilest.ro/ethoscope/
GNU General Public License v3.0
17 stars 25 forks source link

Camera is not cleanly released after streaming video #130

Closed pepelisu closed 3 years ago

pepelisu commented 3 years ago

If after streaming the video a tracking is starting one get the error of empty queue for devices. A restart solves the problem.

ggilestro commented 3 years ago

The problem appears to be with this line:

https://github.com/gilestrolab/ethoscope/blob/013c1cd38a21c958cca7f4b55ed1bd1b3830cbb5/src/ethoscope/web_utils/record.py#L122-L125

serve_forever does not start a thread and the process never leaves that if statement, so it cannot be stopped and the camera is not released. I am working to fix it.

ggilestro commented 3 years ago

This is now fixed. Please note that I completely changed the way we handle streaming so one needs to upddate both the ethoscope AND the node.