Lately I have installed a few cameras at home for video monitoring purpose: the idea is to get ready to leave our home for some vacations from time to time and still ensure that everything at home is safe.
The cameras I'm using so far are from “Tapo” and are working okay so far (except for a regular disconnection issue I still have to investigate). But I don't want to pay for the advanced “AI processing” offered by the company, and instead I would like to check here if there is a way to use those cameras directly for processing in custom programs I could write myself 👍!
/
rtsp://192.168.0.42/stream1
(also entering the account credentials from above) and this worked just fine:import cv2 cap = cv2.VideoCapture("rtsp://root:pass@192.168.0.91:554/axis-media/media.amp") while(cap.isOpened()): ret, frame = cap.read() cv2.imshow('frame', frame) if cv2.waitKey(20) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows()
"homeguard_env": { "inherit": "default_env", "packages": [ "PyQt5", "numpy", "opencv-python" ] },
def get_all_packages(self, desc): """Retrieve all the python packages requested for a given environment desc""" pkgs = [] if "inherit" in desc: parent_name = desc["inherit"] pdesc = self.get_py_env_desc(parent_name) pkgs = self.get_all_packages(pdesc) # Add the packages from this desc: added = desc["packages"] for pkg in added: if pkg not in pkgs: pkgs.append(pkg) # Return all the packages: return pkgs
def run_test(): cap = cv2.VideoCapture("rtsp://nervctrl:xxxxxx@192.168.0.42/stream1") if not cap.isOpened(): logger.error("Cannot open stream.") return count = 0 while(cap.isOpened()): count += 1 if count < 3: _, frame = cap.read() cv2.imshow(f'frame{count}', frame) time.sleep(2.0) if cv2.waitKey(20) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows()