Created
February 18, 2016 19:22
-
-
Save kimadactyl/a6e8954030d663cf36f9 to your computer and use it in GitHub Desktop.
Video previewer. Outputs 10 evenly spaced frames for a directory of videos.
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
Dir.glob('/YOUR_VIDEOS/*.mp4') do |f| | |
name = File.basename(f, ".*") | |
len = `ffprobe #{f} -show_entries format=duration -v quiet -of csv="p=0"` | |
for n in (1..10) | |
l = len.to_f / 10 * n | |
`ffmpeg -i #{f} -ss #{l} -v quiet -vframes 1 './preview/#{name}_#{n}.png'` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment