Skip to content

Instantly share code, notes, and snippets.

@pooza
Created April 3, 2018 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pooza/5886298a74383ff1063750c5fae917fa to your computer and use it in GitHub Desktop.
Save pooza/5886298a74383ff1063750c5fae917fa to your computer and use it in GitHub Desktop.
#!/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)}"
@pooza
Copy link
Author

pooza commented Apr 3, 2018

ffmpegをラップするやつ。
OPTIONSにいろいろ書き足してつかってね。おれはいつもデフォルトだけど…

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