Skip to content

Add object detection, tracking, mobile notifications, and search to any security camera.

remove release func, and dont kill None

Rory Clear40dfcef2ad34
diff --git a/clearcam.py b/clearcam.py
index 2b86e8c..af5aff0 100644
--- a/clearcam.py
+++ b/clearcam.py
@@ -289,8 +289,8 @@ class VideoCapture:
def _open_ffmpeg(self, cam_name):
path = self._get_new_stream_dir(cam_name)
- if cam_name in self.proc: self.proc[cam_name].kill()
- if cam_name in self.hls_proc: self.hls_proc[cam_name].kill()
+ if cam_name in self.proc and self.proc[cam_name]: self.proc[cam_name].kill()
+ if cam_name in self.hls_proc and self.hls_proc[cam_name]: self.hls_proc[cam_name].kill()
src = self.src[cam_name]
if type(src) != str: return # todo, fixes a crash, fix cause
@@ -614,11 +614,6 @@ class VideoCapture:
preds = np.array(preds)
return preds, frame
- def release(self, cam_name):
- self.running[cam_name] = False
- if cam_name in self.proc: self.proc[cam_name].kill()
- if cam_name in self.hls_proc: self.hls_proc[cam_name].kill()
-
def is_bright_color(color):
r, g, b = color
brightness = (r * 299 + g * 587 + b * 114) / 1000