Guest User

Untitled

a guest
Nov 21st, 2016
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. import cv2
  3.  
  4. def main():
  5.     cargarvideo()
  6.     return
  7.  
  8. def cargarvideo():
  9.     vid = ['video_01.mp4', 'video_02.mp4', 'video_03.mp4', 'video_04.mp4', 'video_05.mp4']
  10.     for i in [0,1,2,3,4]:
  11.         cap = cv2.VideoCapture(vid[i])
  12.         while(cap.isOpened()):
  13.             #if cap.isOpened() == False:
  14.             #    break
  15.             ret, fps = cap.read()
  16.             if cap.read() == False:
  17.                 break
  18.             cv2.imshow('Video_Grabado',fps)
  19.             if cv2.waitKey(32) & 0xff == ord('q'):
  20.                 break
  21.     cap.release()
  22.     cv2.destroyAllWindows()
  23.  
  24. if __name__ == "__main__":
  25.     main()
RAW Paste Data