46. • Real Time Streaming Protocolの略
• 最近、ネットワークカメラにおいて、最も一般的に利用
されている映像配信(映像取得)用プロトコル。データ
本体の伝送はRTSPではなくRTP(Real-time
Transport Protocol)によって行う。
• 「rtsp://」で始まるURL(URI)を用い、標準ではTCPの
554番ポートで通信する。
• Atom Cam 2はRTSPをサポート。
RTSPプロトコルとは?
47. import cv2
Async def task_image_create_proc():
try:
cap = cv2.VideoCapture(f”rtsp://{user_id}:{user_pw}@{host}/live”)
ret, frame = cap.read()
if ret == True:
filename = “image.jpg”
cv2.imwrite(‘./’+filename, frame)
cap.release()
cv2.destroyAllWindows()
s3.Bucket(bucket_name).upload_file(‘./’+filename, filename)
except Exception as e:
print(“Exception Occurred: {}”.format€)
finally:
cap.release()
cv2.destroyAllWindows()
• 画像の取得にはOpenCVを使用
Lineでカメラからの画像を受け取る