Created
June 25, 2015 15:18
-
-
Save shoaibi/1654c2b4e9184647a0ff to your computer and use it in GitHub Desktop.
Convert video files in the specified path for my phone(SG4)
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 | |
if [ $# -ne 3 ] | |
then | |
echo "Usage: $0 sourceExtension /path/to/source/files /path/to/save/converted/files" | |
exit 65 | |
fi | |
cd "$2" | |
for fileName in *"$1"; do | |
baseFileName="${fileName%.*}" | |
echo "Converting $fileName" | |
sudo nice -n -15 mencoder "$fileName" -oac mp3lame -ovc xvid -xvidencopts pass=1 -sid 0 -vf scale=480:320 -o "$3/$baseFileName.mp4" &> "/tmp/mencoder.log" | |
done | |
echo "Done!" | |
echo | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment