Skip to content

Instantly share code, notes, and snippets.

@siannopollo
Created July 13, 2011 03:38
Show Gist options
  • Save siannopollo/1079662 to your computer and use it in GitHub Desktop.
Save siannopollo/1079662 to your computer and use it in GitHub Desktop.
Encode my AVI files to MOV using ffmpegX, ruby and AppleScript
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
@siannopollo
Copy link
Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment