Skip to content

Instantly share code, notes, and snippets.

@JasonSpine
Created January 23, 2017 09:07
Show Gist options
  • Save JasonSpine/b99ebe165c1be2be769f2322e659b244 to your computer and use it in GitHub Desktop.
Save JasonSpine/b99ebe165c1be2be769f2322e659b244 to your computer and use it in GitHub Desktop.
Convert HD Camcorder *.MTS films with FFmpeg
# -*- coding: utf-8 -*-
import os
path = './'
listing = os.listdir(path)
for infile in listing:
s=os.getcwd()+'/'+infile.split('.MTS')[0]
command="""ffmpeg -i '%s.MTS' -r 30 -vcodec mpeg4 -acodec libmp3lame\
-sws_flags lanczos -vf 'scale=1280:720:interl=1' -aspect 16:9\
-threads 4 -vb 8000k -ab 320k '%s.avi'"""%(s,s)
os.system(command)
print "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment