Created
January 12, 2015 14:36
-
-
Save ryo1kato/c10e93d8e47cd5cd3628 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
#!/bin/bash | |
set -eu | |
convert_to_mp4 () { | |
input="$1" | |
output="${input%.*}.mp4" | |
ffmpeg -i "$input" -c:v libx264 -crf 23 -profile:v high -r 30 -c:a libfaac -q:a 100 -ar 48000 "$output" | |
} | |
errors=0 | |
for f in "$@" | |
do | |
convert_to_mp4 "$f" || let errors++ | |
done | |
if (( errors > 0 )) | |
then | |
echo "$errors errors for $# input files" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment