Created
July 13, 2011 03:38
-
-
Save siannopollo/1079662 to your computer and use it in GitHub Desktop.
Encode my AVI files to MOV using ffmpegX, ruby and AppleScript
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
Dir[ARGV.join(" ") + '/*.AVI'].each do |movie| | |
command = %{ | |
tell application "ffmpegX" | |
activate | |
set contents of the fifth text field of front window to "#{movie}" | |
set contents of the second text field of front window to "#{movie.sub('AVI.ff.mov', 'mov').sub('AVI', 'mov')}" | |
tell application "System Events" | |
tell process "ffmpegX" to keystroke "\r" | |
end tell | |
end tell | |
}.strip.split("\n").collect {|l| l.strip}.join('\' -e \'') | |
`osascript -e '#{command}'` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
All my movies are taken with the same camera, so this script assumes that I already have ffmpegX configured the way I want it (eg: video resolution, encoding format).