Skip to content

Instantly share code, notes, and snippets.

@rsnk96
Last active October 21, 2018 17:47
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 rsnk96/69dae8b5dac689ce3e7fc19afa83b905 to your computer and use it in GitHub Desktop.
Save rsnk96/69dae8b5dac689ce3e7fc19afa83b905 to your computer and use it in GitHub Desktop.
Outline of a normal video processing code
def process_video():
cap = cv2.VideoCapture("input_file.mp4") # Define the input video handler
out = cv2.VideoWriter("output_file.avi", ...) # Define the output video handler
while (cap.isOpened()): # Loop through the video frames
ret, frame = cap.read() # Read a frame
# ... DO SOME STUFF TO frame... # # Perform some operation
out.write(frame) # Define the input video handler
process_video() # Call the actual function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment