In my previous post I learned how to extract the duration from ffmpeg
for one file.
ffmpeg -i file.mp4 2>&1 | grep Duration | awk '{print $2}' | tr -d ,
which would output something similar to 00:08:07.98
.
What I would like to end up with is a script, where I can say
get_duration.sh *
and it would add all the duration lengths and output something similar to 04:108:1107.198
.
It doesn't have to convert minutes to hours and so on. It would be nice though =)
I can list all the length by
for f in *; do
ffmpeg -i "$f" 2>&1 | grep Duration | awk '{print $2}' | tr -d ,;
done
But how do I add these strange formatted numbers?