import numpy as np import cv2 import time cap = cv2.VideoCapture('http://192.168.50.177:81/stream') while(True): # Capture frame-by-frame ret, frame = cap.read() # Our operations on the frame come here gray = cv2.cvtColor(frame, cv2.COLOR_BGR2BGRA) frame = cv2.resize(frame, (1936,1096)) #frame = cv2.resize(frame, (320, 240)) # Display the resulting frame cv2.imshow('frame',frame) if cv2.waitKey(1) & 0xFF == ord('p'): now = time.strftime("%Y-%m-%d-%H_%M_%S", time.localtime(time.time())) cv2.imwrite('D:\\fatwolf\\company_files\\opencv\\' + now + ".png", frame) print('save: '+now+'.png') elif cv2.waitKey(1) & 0xFF == ord('q'): break # When everything done, release the capture cap.release() cv2.destroyAllWindows()