Skip to content

Instantly share code, notes, and snippets.

@Shubhayu-Das
Created October 8, 2021 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shubhayu-Das/c61c5f92394b65413a942bc0841e97b0 to your computer and use it in GitHub Desktop.
Save Shubhayu-Das/c61c5f92394b65413a942bc0841e97b0 to your computer and use it in GitHub Desktop.
Script to find duration of all videos in a folder
find . -maxdepth 1 -iname '*.mp4' -exec ffprobe -v quiet -of csv=p=0 -show_entries format=duration {} \; | paste -sd+ -| bc | awk '{printf("%d:%02d:%02d:%02d\n",($1/60/60/24),($1/60/60%24),($1/60%60),($1%60))}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment