Created
June 17, 2016 02:54
-
-
Save ctroncoso/0fb2c1d16dd4d4197d39c66eb310f607 to your computer and use it in GitHub Desktop.
Bulk encoding any video ffmpeg can read to small (archive) version mp4
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 | |
PROCESSED_PATH="~/completed/" | |
SMALLIFIED_PATH="~/compressed/" | |
for file in "$@"; do | |
echo ${file%\.*} | |
if ffmpeg -y -i "${file}" -r 24 -vf 'scale=320:-2' -vcodec libx264 -preset veryfast -crf 20 -c:a aac -strict -2 -b:a 128k "small_${file%\.*}.mp4" | |
then mv "small_${file%\.*}.mp4" $SMALLIFIED_PATH && mv "${file}" $PROCESSED_PATH | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment