Skip to content
Snippets Groups Projects
Commit f519557c authored by s47700's avatar s47700
Browse files

Upload New File

parent 22e751fb
No related branches found
No related tags found
No related merge requests found
import cv2
import streamlink
def get_video_stream_url():
url = 'http://192.168.0.205/webcam/?action=stream'
streams = streamlink.streams(url)
if 'best' in streams:
return streams['best'].url
else:
return None
def display_video_stream():
url = get_video_stream_url()
if url:
cap = cv2.VideoCapture(url)
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
cv2.imshow('Video Stream', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
else:
print('Unable to retrieve video stream URL')
if __name__ == '__main__':
display_video_stream()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment