Last active
May 21, 2023 21:28
-
-
Save florianbussmann/1df81d32a59e5b29da105a7543d63e01 to your computer and use it in GitHub Desktop.
Clean videos by duration threshold
This file contains hidden or 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
find . -type f -name *.mp4 -size -10M -print0 | xargs -d '\n' -0 sh -c ' | |
for file do | |
echo "$file" | |
duration=`/volume1/@appstore/ffmpeg/bin/ffprobe -i "$file" -show_entries format=duration -v quiet -of csv="p=0"` | |
echo $duration | |
if [ "${duration%.*}" -lt 10 ]; then | |
echo "Lower than threshold" | |
rm -v "$file" | |
fi | |
done' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment