Created
June 6, 2015 06:12
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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