Skip to content

Commit e5f6e1c

Browse files
committed
test: added python test
* added opencv_rtsp_client script for opening the camera streamer rtsp stream and displaying it in real time from a computer.
1 parent a75a2e8 commit e5f6e1c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

opencv_rtsp_client.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import sys
2+
import cv2
3+
4+
def stream(addr, port):
5+
vcap = cv2.VideoCapture(f"rtsp://{addr}:{port}/mjpeg/1")
6+
while(1):
7+
ret, frame = vcap.read()
8+
cv2.imshow('VIDEO', frame)
9+
cv2.waitKey(1)
10+
11+
if __name__ == "__main__":
12+
if len(sys.argv) != 3:
13+
print("Usage: python ./opencv_rtsp_client <address> <rtsp_port>")
14+
sys.exit(1)
15+
stream(sys.argv[1], sys.argv[2])

0 commit comments

Comments
 (0)