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
cam_port = 2
cam = cv2.VideoCapture(cam_port)
RTSP_ADDR = 'rtsp://localhost:8554/cam'
DEVICE_ADDR = 2
cam = cv2.VideoCapture(DEVICE_ADDR)
while True:
result, image = cam.read()
@ -17,5 +19,6 @@ while True:
break
cam.release()
cv2.destroyWindow('Camera')
cv2.destroyAllWindows()

View File

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