Skip to content

Instantly share code, notes, and snippets.

Created June 19, 2021 11:00
What would you like to do?
#%% 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