Skip to content

Instantly share code, notes, and snippets.

@ryo1kato
Created January 12, 2015 14:36
Show Gist options
  • Save ryo1kato/c10e93d8e47cd5cd3628 to your computer and use it in GitHub Desktop.
Save ryo1kato/c10e93d8e47cd5cd3628 to your computer and use it in GitHub Desktop.
#!/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