sample from server
This commit is contained in:
parent
326a1acd99
commit
44a4d8b927
25
sample-server.py
Normal file
25
sample-server.py
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
import cv2
|
||||||
|
|
||||||
|
# Adres strumienia MJPEG z VLC
|
||||||
|
stream_url = "http://localhost:8080"
|
||||||
|
|
||||||
|
# Otwórz strumień jako źródło wideo
|
||||||
|
cap = cv2.VideoCapture(stream_url)
|
||||||
|
|
||||||
|
if not cap.isOpened():
|
||||||
|
print("Nie można otworzyć kamery!")
|
||||||
|
exit()
|
||||||
|
|
||||||
|
while True:
|
||||||
|
ret, frame = cap.read()
|
||||||
|
if not ret:
|
||||||
|
print("Nie udało się odczytać klatki!")
|
||||||
|
break
|
||||||
|
|
||||||
|
cv2.imshow("Podgląd z kamery", frame)
|
||||||
|
|
||||||
|
if cv2.waitKey(1) & 0xFF == ord('q'):
|
||||||
|
break
|
||||||
|
|
||||||
|
cap.release()
|
||||||
|
cv2.destroyAllWindows()
|
||||||
Loading…
Reference in a new issue