Skip to content

Instantly share code, notes, and snippets.

@derpeter
Created May 31, 2024 09:39
Show Gist options
  • Save derpeter/aecf6f5604997708b64a47112723494d to your computer and use it in GitHub Desktop.
Save derpeter/aecf6f5604997708b64a47112723494d to your computer and use it in GitHub Desktop.
to25fps.py
import os
import subprocess
path = os.getcwd()
for file in os.listdir(path):
if file.endswith("mp4"):
if "old" not in file:
f = os.path.join(path, file)
print("found " + f)
old_file = os.path.join(path, file.split(".")[0] + "-old.mp4")
print("moving " + f + " to " + old_file)
os.rename(f, old_file)
subprocess.run(["ffmpeg", "-i", old_file, "-filter:v", "fps=25", f])
else:
print("file " + file + " already processed, skipping")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment