add RTSP example

This commit is contained in:
Alexander Popov 2023-09-26 23:58:27 +03:00
parent a71798d5c6
commit f8b9ae2443
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6
2 changed files with 9 additions and 2 deletions

View File

@ -2,8 +2,10 @@
import cv2 import cv2
cam_port = 2 RTSP_ADDR = 'rtsp://localhost:8554/cam'
cam = cv2.VideoCapture(cam_port) DEVICE_ADDR = 2
cam = cv2.VideoCapture(DEVICE_ADDR)
while True: while True:
result, image = cam.read() result, image = cam.read()
@ -17,5 +19,6 @@ while True:
break break
cam.release() cam.release()
cv2.destroyWindow('Camera') cv2.destroyWindow('Camera')
cv2.destroyAllWindows() cv2.destroyAllWindows()

View File

@ -0,0 +1,4 @@
[tool.black]
skip-string-normalization = true
pycodestyle = true
line-length = 100