Skip to content

Instantly share code, notes, and snippets.

@PharaohKJ
Created November 29, 2023 23:12
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 PharaohKJ/ae77650cf437e12bbd54d0d03415a44c to your computer and use it in GitHub Desktop.
Save PharaohKJ/ae77650cf437e12bbd54d0d03415a44c to your computer and use it in GitHub Desktop.
files = Dir.entries('./').reject{ |x| x.include?('resized') }.select { |x| x.include?('mp4') }
files.each do |fname|
size = 240
cmd = %Q[ffmpeg -y -i '#{fname}' -vf scale=#{size}\:0 '#{fname}resized-#{size}.mp4']
cmd = %Q[ffmpeg -y -i '#{fname}' -vf scale=#{size}\:140 '#{fname}resized-#{size}.mp4']
puts cmd
system(cmd)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment