####Description
Extracts...
- filename
- framerate (average)
- bitrate (average)
- duration
- last modified timestamp
... from a set of video files.
!#/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,end > original_times.csv | |
cat times_temp2.csv >> original_times.csv | |
rm times_temp2.csv | |
cat times.csv |