Skip to content

Instantly share code, notes, and snippets.

@milothiesen
Last active May 27, 2016 19:45
Show Gist options
  • Save milothiesen/82b9abd2f4b12752fa2622f9819fa72a to your computer and use it in GitHub Desktop.
Save milothiesen/82b9abd2f4b12752fa2622f9819fa72a to your computer and use it in GitHub Desktop.
#developed by Maile Thiesen
#dependencies are homebrew and mediainfo, use brew install mediainfo.
#!/usr/bin/ruby
library_path = ARGV[0]
files_list = %x[find #{library_path} -name "*.mov"].split("\n")
files_list.each do |filename|
#enter the duration you want to match to here--vvv#
match_duration = "26s 727ms\n"
filename.chomp!
mediainfo_output = %x[mediainfo '#{filename}']
duration = %x[mediainfo --Inform="Video;%Duration/String%" '#{filename}']
# puts filename + " DURATION = " + duration
if duration == match_duration
puts filename + " DURATION = " + duration + " IS A MATCH!!!!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment