Skip to content

Instantly share code, notes, and snippets.

@victusfate
Created May 18, 2020 21:58
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 victusfate/5a36b2c9ecf816d289c090e04f6a04e2 to your computer and use it in GitHub Desktop.
Save victusfate/5a36b2c9ecf816d289c090e04f6a04e2 to your computer and use it in GitHub Desktop.
shrink some videos
files = Dir.glob("*.mp4") + Dir.glob("*.m4v") + Dir.glob("large/*.mp4") + Dir.glob("large/*.m4v")
puts files
files.each do |file|
basename = File.basename(file).gsub(/[^0-9a-z.]/i, '')
# puts basename
system("ffmpeg -y -i #{file} -ss 2 -t 60 shrunk/sampled_#{basename}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment