Last active
July 24, 2018 23:25
-
-
Save Sysetup/4d6dfc71f2a54762cd034eec113684cd to your computer and use it in GitHub Desktop.
Cut the last 10 seconds of several video files "Bash Script"
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
for file in `find . -name '*.mp4'` | |
do | |
echo "This is the file: " $file | |
DURATION=`ffprobe -i $file -show_format -v quiet | sed -n 's/duration=//p'` | |
echo "Duration: " $DURATION | |
FINAL=`echo "$DURATION - 10" | bc` | |
echo "Final Duration: " $FINAL | |
ffmpeg -i $file -t $FINAL -c copy $file.mp4 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment