Skip to content

Instantly share code, notes, and snippets.

@wermarter
Created December 19, 2017 02:03
Show Gist options
  • Save wermarter/dce55075275d93baf8f6093c9b2717e9 to your computer and use it in GitHub Desktop.
Save wermarter/dce55075275d93baf8f6093c9b2717e9 to your computer and use it in GitHub Desktop.
Using FFMPEG to recode to 480p from text file contains list of dir
import os
from TheFetchers.TheCommons import filename_check
with open(input('> '), 'r') as f:
files = [i.strip() for i in f.readlines()]
for file in files:
fn = os.path.splitext(file)[0]+'.mp4'
output_file = filename_check(fn, True)
cmd = "ffmpeg -i \"%s\" -vf scale=-2:480 -c:v libx264 \"%s\"" % (file, output_file)
os.system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment