Get total duration of video files in a directory

In this article let’s discuss about Get total duration of video files in a directory. Let’s go through the following methods without any delay.

Method 1:

find . -maxdepth 1 -iname '*.mp4' -exec ffprobe -v quiet -of csv=p=0 -show_entries format=duration {} \;
149.233333
130.146667
275.690000

find . -maxdepth 1 -iname '*.mp4' -exec ffprobe -v quiet -of csv=p=0 -show_entries format=duration {} \; | paste -sd+ -| bc
555.070000

Hope the above solution works.

Realted Posts : Bash: ufw : commande introuvable