Skip to content

Instantly share code, notes, and snippets.

@gordonbanderson
Created June 6, 2015 06:12
Show Gist options
  • Save gordonbanderson/4c29a5d977299f6c75c7 to your computer and use it in GitHub Desktop.
Save gordonbanderson/4c29a5d977299f6c75c7 to your computer and use it in GitHub Desktop.
Create 5x5 grid thumbnail sheet of all mp4 files in a given directory - pipe the output of this script into bash
puts "mkdir thumbs"
Dir.glob('*.mp4').sort.select{ |e|
filename = "#{e}"
percents = []
(4..100).step(4) do |n|
percents << n
end
for p in percents
puts "ffmpegthumbnailer -s 400 -i #{e} -t #{p}% -o thumbs/#{e}-#{p}.jpg"
end
cmd = "montage -geometry 300x300+4+4 -tile 5x "
for p in percents
cmd << "thumbs/#{e}-#{p}.jpg "
end
cmd << " thumbs/sheet-#{e}.jpg"
puts cmd
for p in percents
puts "rm thumbs/#{e}-#{p}.jpg"
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment