Files
videobeaux/programs/extract_frames.py
Agamemnon Juunes 2f30c6c18b initial commit
2024-06-19 12:44:55 -04:00

12 lines
389 B
Python

from utils.ffmpeg_operations import run_ffmpeg_command
def extract_frames(input_file, output_folder, frame_rate):
command = [
"ffmpeg",
"-i", input_file,
"-vf", f"fps={frame_rate}",
f"{output_folder}/frame_%04d.png"
]
run_ffmpeg_command(command)
print(f"Frames extracted from {input_file} at {frame_rate} fps and saved to {output_folder}")