Initial commit
This commit is contained in:
25
main.py
Normal file
25
main.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import cv2
|
||||
|
||||
STREAM_URL = "rtsps://192.168.1.1:7441/1bIx3jYaXNxSPXlF?enableSrtp"
|
||||
OUTPUT = "data/frame.jpg"
|
||||
|
||||
|
||||
def main():
|
||||
cap = cv2.VideoCapture(STREAM_URL, cv2.CAP_FFMPEG)
|
||||
if not cap.isOpened():
|
||||
print("Failed to open stream")
|
||||
return
|
||||
|
||||
ret, frame = cap.read()
|
||||
cap.release()
|
||||
|
||||
if not ret:
|
||||
print("Failed to read frame")
|
||||
return
|
||||
|
||||
cv2.imwrite(OUTPUT, frame)
|
||||
print(f"Saved {OUTPUT}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user