Last active
August 28, 2015 23:09
-
-
Save predictiple/8855d203f7c16be6dab6 to your computer and use it in GitHub Desktop.
This file contains 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
!#/bin/bash | |
find . -type f -iname "*.avi" -print | while read line; do | |
duration=$(ffprobe -i $line 2>&1 > /dev/null |grep Duration |cut -d',' -f1 |cut -d' ' -f4) | |
framerate=$(ffprobe -i $line 2>&1 > /dev/null |grep Stream |cut -d',' -f4 |cut -d' ' -f2) | |
bitrate=$(ffprobe -i $line 2>&1 > /dev/null |grep Duration |cut -d',' -f3 |cut -d' ' -f3-) | |
modified=$(stat $line |grep Modify |cut -d' ' -f3 |cut -d'.' -f1) | |
file=$(echo $line | cut -d'/' -f2) | |
echo $file,$framerate,$bitrate,$duration,$modified >> times_temp1.csv | |
done | |
sort -df -o times_temp2.csv times_temp1.csv | |
rm times_temp1.csv | |
echo file,framerate,bitrate,duration,modified > times.csv | |
cat times_temp2.csv >> times.csv | |
rm times_temp2.csv | |
cat times.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Profile a set of AVI files and store the stats in a CSV for subsequent analysis.