VOODOO3D-unofficial / make_video.py
ameerazam08's picture
Upload folder using huggingface_hub
03da825 verified
raw
history blame contribute delete
779 Bytes
from moviepy.editor import ImageSequenceClip
import os
def create_video_from_frames(frame_folder, base_name, num_frames, fps, output_file):
# Generate the list of filenames
filenames = [os.path.join(frame_folder, f"{base_name}_{i}.png") for i in range(num_frames)]
# Create the video clip
clip = ImageSequenceClip(filenames, fps=fps)
# Write the video to a file
clip.write_videofile(output_file, codec='libx264')
# Example usage
frame_folder = "/results/voodoo3d_test" # Replace with the path to your frames folder
base_name = "0000"
num_frames = 1567 # Replace with the number of frames you have
fps = 24 # Frames per second
output_file = "output_video.mp4"
create_video_from_frames(frame_folder, base_name, num_frames, fps, output_file)