Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- import imageio
- cap = cv2.VideoCapture('stillalive.mov')
- cap.set(1 ,62)
- length = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) - 62
- print('length=%d' % length)
- frames = []
- for i in range(1668):
- ret, frame = cap.read()
- frames.append(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
- imageio.mimsave("stillalive.gif", frames, fps=60)
Add Comment
Please, Sign In to add comment