Advertisement
lamiastella

test cap

Oct 29th, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. import cv2
  2. cap = cv2.VideoCapture('/home/grad3/jalal/PycharmProjects/hw4_cs58‌​5/Concession_LAN_8‌​‌​00‌​k.mp4',cv2.CAP_FFMPEG)
  3.  
  4. if not cap.isOpened():
  5.     print('not opened')
  6.  
  7. while True:
  8.     ret,frame = cap.read()
  9.  
  10.     if ret == False:
  11.         print('frame empty')
  12.         break
  13.     cv2.imshow('frame', frame)
  14.     if cv2.waitKey(1) == ord('q'):
  15.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement