Created
January 5, 2014 14:30
-
-
Save un33k/8268843 to your computer and use it in GitHub Desktop.
Quickly convert all Windows Media Videos to MP4 in a directory using ffmpeg.
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 | |
import sys | |
# Install ffmpeg | |
# Put all your wmv in a directory | |
# Copy this file inside the directory | |
# run `python video_converter.py | |
############################################ | |
WMV_DIR = "." | |
wmv_files = [ f for f in os.listdir(WMV_DIR) if os.path.isfile(os.path.join(WMV_DIR,f)) and 'wmv' in f ] | |
for f in wmv_files: | |
input = f | |
output = f.replace('wmv', 'mp4') | |
print 'processing {} - > {}'.format(input, output) | |
os.system('ffmpeg -i {} -strict -2 {}'.format(input, output)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment