Created
December 23, 2009 19:05
-
-
Save vitaliel/262711 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/ruby | |
| # Convert videos to mp4 for my TV | |
| def convert(ext) | |
| # ext = "ogv" | |
| files = Dir["*.#{ext}"] | |
| files.each do |file| | |
| out = "#{file.gsub(/#{ext}$/, '')}mp4" | |
| next if test ?f, out | |
| # cmd = "ffmpeg -i #{file} -f mp4 -vcodec copy -acodec copy #{out}" | |
| cmd = "ffmpeg -i #{file} -threads 4 -f mp4 #{out}" | |
| puts cmd | |
| system cmd | |
| end | |
| end | |
| %w{mov flv f4v ogv ogg}.each do |ext| | |
| convert(ext) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment