Skip to content

Instantly share code, notes, and snippets.

@andersonfreitas
Last active December 15, 2015 17:29
Show Gist options
  • Save andersonfreitas/5297281 to your computer and use it in GitHub Desktop.
Save andersonfreitas/5297281 to your computer and use it in GitHub Desktop.
Length of a folder with MP4 files
mp4sum() {
TOTAL=0
for x in $1/*.mp4
do
size=`mp4box -std -diso $x | grep 'TimeScale="1000"' | awk 'BEGIN{FS="\""};{ print $8 }'`
TOTAL=`expr $TOTAL + $size / 1000`
done
x='obase=60;'$TOTAL
print $x | bc
}
for x in *
for> do
for> print $x
for> mp4sum $x
for> done