Skip to content

Instantly share code, notes, and snippets.

@predictiple
Last active August 28, 2015 23:09
Show Gist options
  • Save predictiple/8855d203f7c16be6dab6 to your computer and use it in GitHub Desktop.
Save predictiple/8855d203f7c16be6dab6 to your computer and use it in GitHub Desktop.
!#/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
@predictiple
Copy link
Author

Profile a set of AVI files and store the stats in a CSV for subsequent analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment