File size: 890 Bytes
d63d128 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import sys
import argparse
import cv2
import numpy as np
def create_dummy_video(output_path, duration, resolution):
width, height = map(int, resolution.split("*"))
fps = 24
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
out = cv2.VideoWriter(output_path, fourcc, fps, (width, height))
# Δημιουργία μαύρων frames
for _ in range(fps * duration):
frame = np.zeros((height, width, 3), dtype=np.uint8)
out.write(frame)
out.release()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--prompt", type=str, required=True)
parser.add_argument("--output", type=str, required=True)
parser.add_argument("--duration", type=int, default=5)
parser.add_argument("--size", type=str, default="640*480")
args = parser.parse_args()
create_dummy_video(args.output, args.duration, args.size)
|