Created
April 3, 2018 21:04
-
-
Save pooza/5886298a74383ff1063750c5fae917fa to your computer and use it in GitHub Desktop.
This file contains 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/env ruby | |
require 'shellwords' | |
DEST_DIR = '/usr/local/samba/movie' | |
OPTIONS = '-y -vf scale=720:-1' | |
unless ARGV.first | |
puts "usage: #{File.basename(__FILE__)} filename" | |
exit 1 | |
end | |
src = File.expand_path(ARGV.first) | |
unless File.exist?(src) | |
puts "not found: #{src}" | |
exit 1 | |
end | |
dest = File.join(DEST_DIR, "#{File.basename(src, '.m2ts')}.mp4") | |
system "/usr/bin/ffmpeg -i #{Shellwords.escape(src)} #{OPTIONS} #{Shellwords.escape(dest)}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ffmpegをラップするやつ。
OPTIONSにいろいろ書き足してつかってね。おれはいつもデフォルトだけど…