From f8b9ae2443f33713859ffc32838ebbf70f4aebbb Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Tue, 26 Sep 2023 23:58:27 +0300 Subject: [PATCH] add RTSP example --- code/Python/opencv/{capture-image.py => capture.py} | 7 +++++-- code/Python/pyproject.toml | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) rename code/Python/opencv/{capture-image.py => capture.py} (77%) create mode 100644 code/Python/pyproject.toml diff --git a/code/Python/opencv/capture-image.py b/code/Python/opencv/capture.py similarity index 77% rename from code/Python/opencv/capture-image.py rename to code/Python/opencv/capture.py index da97d13..56c9265 100755 --- a/code/Python/opencv/capture-image.py +++ b/code/Python/opencv/capture.py @@ -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() diff --git a/code/Python/pyproject.toml b/code/Python/pyproject.toml new file mode 100644 index 0000000..cab6ef7 --- /dev/null +++ b/code/Python/pyproject.toml @@ -0,0 +1,4 @@ +[tool.black] +skip-string-normalization = true +pycodestyle = true +line-length = 100