Closed ivanovd closed 4 years ago
Thanks a lot for this issue. I need to test that as well on my mirror. Could be that pm2 not send the close command correctly. And because it is in a thread i will try something different.
Hi @nischi , were you able to replicate that on your setup?
I see that you made some changes and I pulled the update, however it still fails to close the stream. No rush, I just thought I can give some feedback :)
@ivanovd thanks. yes i'm investigating. do not find a solution yet, strange ist that sometimes they close the stream and sometimes not.
Ah, i thought that was just my set-up doing that. I am relieved to know its not just me. A reboot fixes it every time though. I wonder if we couldn’t just add a kill command to the pm2 mm.sh?
Hey guys,
changing
from stream import VideoStream
to from imutils.video import VideoStream
and
vs.stop()
to
if args["usePiCamera"] >= 1: vs.stop() else: vs(src=0).stop()
helped me to solve the problem.
@hknozturk awesome, thanks for the hint. is it maybe possible for you to do a pull request?
If you restart MagicMirror with
pm2 starts another process, however, the video stream is not closed in the previous process and stays open, thus, the new process cannot start its own video stream and recognize faces in it because there is already another stream opened and not closed, therefore in the new instance of MagicMirror no face recognition is happening.
That is very evident with external USB cameras that have a usage LED. It stays lit even after you close MagicMirror. The issue is resolved when you restart the Raspberry.