Skip to content

Instantly share code, notes, and snippets.

@infovore
Created October 21, 2015 13:21
Show Gist options
  • Save infovore/313800425222073f0e91 to your computer and use it in GitHub Desktop.
Save infovore/313800425222073f0e91 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
unless ARGV[0] && ARGV[1]
puts "Usage: fadeinout INPUT OUTPUT [DURATION]"
exit
end
if ARGV[2]
duration = ARGV[2].to_f
else
duration = 3
end
`ffmpeg -i #{ARGV[0]} -vf "fade=t=in:st=0:d=#{duration},fade=t=out:st=101:d=3" -af "afade=t=in:st=0:d=#{duration},afade=t=out:st=101:d=3" #{ARGV[1]}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment