Last active
August 29, 2015 14:04
-
-
Save Kichrum/70b630407374494afa38 to your computer and use it in GitHub Desktop.
Convert video files to mp4, webm, flv and png formats
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 | |
#author : Kichrum | |
files=$(ls *.avi); | |
outputFolder="output/" | |
for file in $files | |
do | |
outputFile=${file//.avi/}; | |
printf "\n\n === Converting $file => $outputFile.mp4 === \n"; | |
`ffmpeg -i "$file" -y -b:a 128k -vcodec libx264 -b:v 1200k -flags +aic+mv4 "$outputFolder$outputFile.mp4"` | |
printf "\n\n === Converting $file => $outputFile.webm === \n"; | |
`ffmpeg -i "$file" -y -vcodec libvpx -b:v 1200k -qmin 10 -qmax 20 "$outputFolder$outputFile.webm"` | |
printf "\n\n === Converting $file => $outputFile.flv === \n"; | |
`ffmpeg -i "$file" -y -b:v 1200k -qmin 1 -qmax 5 -ar 44100 "$outputFolder$outputFile.flv"` | |
printf "\n\n === Creating picture for $file => $outputFile.jpg === \n"; | |
`ffmpeg -i "$file" -y -vframes 1 -ss 00:00:01 -f image2 "$outputFolder$outputFile.jpg"` | |
done; | |
echo ' === All Done === '; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment