|
|
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)) |
|
|
|
|
|
|
|
|
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) |
|
|
|