Last active
January 27, 2018 13:40
-
-
Save rogeriolino/b2abcbbc0f7bd8ebc18b4cd0975f5a3b to your computer and use it in GitHub Desktop.
Scale MP4 video to 320px using ffmpeg
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
# | |
# Video Scaler | |
# https://gist.github.com/rogeriolino/b2abcbbc0f7bd8ebc18b4cd0975f5a3b | |
# | |
# Place the MP4 files in the same video-scaler.sh script directory. | |
# Finished (done) files will placed in $FINISHED_DIR directory. | |
# New resized files will placed in $OUTPUT_DIR directory. | |
# | |
SCALE=320 | |
OUTPUT_DIR=output | |
FINISHED_DIR=converted | |
mkdir -p $OUTPUT_DIR | |
mkdir -p $FINISHED_DIR | |
echo "Scaling..." | |
find -maxdepth 1 -name "*.mp4" -exec ffmpeg -i {} -vf scale=$SCALE:-1 $OUTPUT_DIR/{}-$SCALE.mp4 \; -exec mv {} $FINISHED_DIR \; | |
echo "done!" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment