pip install requirements.txt
python app.py
cv2.VideoCapture(0)
cv2.VideoCapture('rtsp://username:password@camera_ip_address:554/user=username_password='password'_channel=channel_number_stream=0.sdp')
cv2.VideoCapture('rtsp://mamun:123456@101.134.16.117:554/user=mamun_password=123456_channel=0_stream=0.sdp')
cv2.VideoCapture('rtsp://mamun:123456@101.134.16.117:554/user=mamun_password=123456_channel=1_stream=0.sdp')
cv2.imencode('.jpg', frame)[1].tobytes()
Write this end of the line camera.py
if __name__ == "__main__" :
cap = CameraStream().start()
while True :
frame = cap.read()
cv2.imshow('webcam', frame)
if cv2.waitKey(1) == 27 :
break
cap.stop()
cv2.destroyAllWindows()
- Multi Thread Use From allskyee's Open-CV Multi-Thread Gist