Created
September 18, 2018 07:28
-
-
Save tingplenting/63f9b5b654c3871293e654cd9d1a7973 to your computer and use it in GitHub Desktop.
bulk convert with ffmpeg and python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
DIRECTORY = "videos2" | |
for f in os.listdir(DIRECTORY): | |
if f.endswith(".mp4"): | |
in_file = DIRECTORY + '/' + f | |
out_file = DIRECTORY + '/ytout-- ' + f | |
ex = 'ffmpeg -i "{in_file}" -c:v libx264 -preset slow -profile:v high -crf 18 -coder 1 -pix_fmt yuv420p -movflags +faststart -g 30 -bf 2 -c:a aac -b:a 384k -profile:a aac_low "{out_file}"'.format(in_file=in_file, out_file=out_file) | |
os.system(ex) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment