Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 2088

How to use a URL as input in OpenCV

$
0
0
My project consists on making some operations on a streaming video in real time thanks to OpenCV using the video URL. I chose to change the color of the video(or its resolution, 2 easy codes) it worked perfectly when I generated a streaming video from my laptop camera. but when I put the URL as an input it didn't. here what the 2 URLs I am using look like http://192.168.137.191:5000/feed1 http://192.168.137.191:5000/stream.html and here is my code import cv2 import numpy as np cap = cv2.VideoCapture('http://192.168.137.191:5000/feed1') while True: ret, frame=cap.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) cv2.imshow('gray',gray) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows

Viewing all articles
Browse latest Browse all 2088

Trending Articles