Created
September 7, 2017 19:00
-
-
Save talmobi/f36bc4fa12303c4244435ea45fb67cc0 to your computer and use it in GitHub Desktop.
bash script to convert avi to mp4 with ffmpeg
This file contains hidden or 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 | |
# Usage: ./convert.sh file | |
for arg; do | |
echo "" | |
echo "arg: $arg" | |
inputFile=$arg | |
outputFile="$inputFile.output.mp4" | |
echo "" | |
echo "converting $inputFile" | |
echo "" | |
echo "to $outputFile ..." | |
echo "" | |
# echo "input: $inputFile, output: $outputFile" | |
/c/Users/Ada/Downloads/ffmpeg/bin/ffmpeg.exe -i $inputFile -c:v libx264 -crf 19 -preset slow -c:a aac -b:a 192k -ac 2 $outputFile | |
if [ $? -eq 0 ]; then | |
echo "" | |
echo "conversion completed [$inputFile] -> [$outputFile]" | |
else | |
echo "" | |
echo "conversion failed" | |
fi | |
sleep 2 | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment