Skip to content

Instantly share code, notes, and snippets.

@monogenea
Created June 19, 2021 11:00
Show Gist options
  • Save monogenea/d8eb6f7f290753df6d6543467dce6ec5 to your computer and use it in GitHub Desktop.
Save monogenea/d8eb6f7f290753df6d6543467dce6ec5 to your computer and use it in GitHub Desktop.
#%% Load video capture and init VideoWriter
vid = cv2.VideoCapture('input/input.mp4')
vid_w, vid_h = int(vid.get(3)), int(vid.get(4))
out = cv2.VideoWriter('output/output.mp4', cv2.VideoWriter_fourcc(*'mp4v'),
vid.get(cv2.CAP_PROP_FPS), (vid_w, vid_h))
# Check if capture started successfully
assert vid.isOpened()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment