Skip to content

Instantly share code, notes, and snippets.

@Andrew-Pynch
Created March 22, 2020 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andrew-Pynch/f19a2ab86b6375ff7bf4a17732aea6c6 to your computer and use it in GitHub Desktop.
Save Andrew-Pynch/f19a2ab86b6375ff7bf4a17732aea6c6 to your computer and use it in GitHub Desktop.
import sys
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
vidcap = cv2.VideoCapture('neuralink3.mp4')
success,image = vidcap.read()
count = 0
while success:
cv2.imwrite("jpg_extraction/frame%d.jpg" % count, image) # save frame as JPEG file
success,image = vidcap.read()
print('Read a new frame: ', success)
count += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment