Calculating the Size of Your Video Library
2016 December 07

This command will calculate the size of your movie and video library in days. You can modify the awk command as you see fit to calculate the time lengths.

The find command will find all movie files in that directory and the sed command filters it out.

find . -type f -exec file -N -i -- {} + | sed -n 's!: video/[^:]*$!!p' |
while read line ;
    do ffprobe -i "$line" -show_entries format=duration -v quiet -of csv="p=0"
done > times
awk '{s += $1} END { print int(s) / 3600 / 24 }' times

This command does not work on mac, due to them using a different version of file that returns a different format for what the file is.

*****
Written by Henry J Schmale on 2016 December 07