Hbvsa's picture
Upload folder using huggingface_hub
6d2982b verified
raw
history blame contribute delete
329 Bytes
import cv2
def get_video_properties(video_path):
cap = cv2.VideoCapture(video_path)
fps = int(cap.get(cv2.CAP_PROP_FPS))
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
return cap, fps, width, height, fourcc