Skip to content

Instantly share code, notes, and snippets.

@MahouShoujoMivutilde
Last active June 4, 2017 17:14
Show Gist options
  • Save MahouShoujoMivutilde/8a3a8e3964aeb0c064c3a676c5055f03 to your computer and use it in GitHub Desktop.
Save MahouShoujoMivutilde/8a3a8e3964aeb0c064c3a676c5055f03 to your computer and use it in GitHub Desktop.
ffmpeg x64 and x32 in one cli
#! python3
from os import system
from sys import argv
from time import time
from datetime import timedelta
# ffmpeg x32 in PATH
# ffmpeg x32: ff -arg1 -arg2...
# ffmpeg x64: ff 64 -arg1 -arg2...
ffmpeg = 'ffmpeg'
ffmpeg64 = r'C:\ffmpeg-64\bin\ffmpeg.exe'
if __name__ == '__main__':
start = 1
if len(argv) > 1 and argv[1] == '64':
start = 2
ffmpeg = ffmpeg64
start_time = time()
system('{} -hide_banner {}'.format(ffmpeg, ' '.join(['"{}"'.format(arg) if arg.find(' ') != -1 else arg for arg in argv[start:]]))) # space handling, other...
print('\nProcessing time: {}'.format(str(timedelta(seconds=round(time() - start_time)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment