Skip to content

Instantly share code, notes, and snippets.

@stucka
Created July 24, 2013 13:59
Show Gist options
  • Save stucka/6070836 to your computer and use it in GitHub Desktop.
Save stucka/6070836 to your computer and use it in GitHub Desktop.
Convert MOD video files to a more usable format, MPG, quickly. Maybe.
import sys
#from subprocess import call
import subprocess
for infile in sys.argv[1:]:
outfile=infile[0:-3] + 'mpg'
print "Trying to convert " + infile + " to " + outfile
sys.stdout.flush()
commandstring = "ffmpeg -i " + infile + " -acodec copy -vcodec copy " + outfile
subprocess.call(commandstring, shell=True)
# #Just use the "Build Applet" utility:
# #/Developer/Applications/Utilities/MacPython\ 2.5/Build\ Applet.app
# #and the dropped file paths will be available thru sys.argv.
# Note that you may have to use Python2.5 (or a patched version) -- See this note: https://bitbucket.org/ronaldoussoren/py2app/issue/16/argv-emulation-code-needs-rewrite
# Quick example -- edit this file and put it on your desktop:
# #!/usr/bin/python2.5
# import sys
# print sys.argv
# Control-click on it, and select open with "Build Applet (2.5.4)"
# App icon will appear on desktop.
# Open Console Utility & clear display.
# Drop some files onto App icon -- you'll see the print in the console window.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment