Advertisement
CSenshi

CV2 - Video Capture

Sep 10th, 2020
1,150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. import numpy as np
  2. import cv2
  3.  
  4. cap = cv2.VideoCapture('rtsp://admin:oniani12@192.168.0.101:554')
  5.  
  6. while(True):
  7.    
  8.     # Capture frame-by-frame
  9.     ret, frame = cap.read()
  10.     frame = cv2.resize(frame, (0,0), fx=0.7, fy=0.7)
  11.    
  12.     # Our operations on the frame come here
  13.     # gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  14.  
  15.     # Display the resulting frame
  16.     cv2.imshow('frame',frame)
  17.     if cv2.waitKey(1) & 0xFF == ord('q'):
  18.         break
  19.  
  20. # When everything done, release the capture
  21. cap.release()
  22. cv2.destroyAllWindows()
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement