Add ip cam script and video resource

This commit is contained in:
Laurent
2026-10-12 14:12:13 +02:00
parent 5c68c528f6
commit fe9e226546
3 changed files with 27 additions and 0 deletions

25
camera.py Normal file
View File

@@ -0,0 +1,25 @@
import cv2 as cv
import time
ip = "192.168.137.100"
vid = cv.VideoCapture(f"http://{ip}:8080/video?1920x1080")
cv.namedWindow("Stream", cv.WINDOW_NORMAL)
while True:
ret, frame = vid.read()
if not ret:
raise Exception("Failed to read image!")
cv.imshow("Stream", frame)
# Set window size once, after the window actually exists
if cv.getWindowProperty("Stream", cv.WND_PROP_VISIBLE) >= 0:
cv.resizeWindow("Stream", 1280, 720)
if cv.waitKey(1) & 0xFF == ord("q"):
break
vid.release()
cv.destroyAllWindows()

View File

@@ -3,3 +3,5 @@ pyside6
keras
tensorflow
opencv-python

Binary file not shown.