Files
Brandon Thomas 5ab5b1c036 add UniAnimate (see notes)
@ d7814fa44a0a1154524b92fce0e3133a2604d333

https://github.com/ali-vilab/UniAnimate
2025-02-03 18:21:13 -05:00

25 lines
414 B
Python

import numpy as np
import cv2
cap = cv2.VideoCapture('workspace/img_dir/tst.mp4')
fourcc = cv2.VideoWriter_fourcc(*'H264')
ret, frame = cap.read()
vid_size = frame.shape[:2][::-1]
out = cv2.VideoWriter('workspace/img_dir/testwrite.mp4',fourcc, 8, vid_size)
out.write(frame)
while(cap.isOpened()):
ret, frame = cap.read()
if not ret: break
out.write(frame)
cap.release()
out.release()