Created
November 4, 2021 15:38
-
-
Save jerry73204/b73b99913e377d2fe7bf67afd67a5dce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ $# -ne 1 ] ; then | |
echo "Usage: $0 DIRECTORY" | |
fi | |
cd "$1" && | |
find . -type f -name '*.avi' -print0 | | |
while IFS= read -r -d $'\0' file; do | |
printf "%s\t" "$file" | |
ffmpeg -i "$file" -map 0:v:0 -c copy -f null -y /dev/null </dev/null 2>&1 | grep -Eo 'frame= *[0-9]+ *' | grep -Eo '[0-9]+' | tail -1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment