
- import cv2
- cap=cv2.VideoCapture(r'E:\zj\Imageprocessing\Video\20190507-130-300.avi')
- isOpened=cap.isOpened
- print(isOpened)
- fps=cap.get(cv2.CAP_PROP_FPS)
- width=int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
- height=int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
- print(fps,width,height)
- i=1
- flag=True
- while(flag):
- (flag,frame)=cap.read()
- filename='C:\\Users\\yh\\Desktop\\test\\o'+str(i)+'.jpg'
- if flag==True:
- cv2.imwrite(filename,frame,[cv2.IMWRITE_JPEG_LUMA_QUALITY,100])
- i=i+1
- print('endl')
