Skip to content

Instantly share code, notes, and snippets.

@kristianfreeman
Created September 5, 2012 08:02
Show Gist options
  • Save kristianfreeman/3632972 to your computer and use it in GitHub Desktop.
Save kristianfreeman/3632972 to your computer and use it in GitHub Desktop.
Using mencoder to combine AVIs... legal AVIs.
#!/bin/sh
echo "Checking for mencoder..."
if ! type "mplayer" > /dev/null; then
echo "mencoder not found. Attempting install with brew"
if ! type "brew" > /dev/null; then
echo "Homebrew not installed. Fail."
exit
fi
echo "Now installing mencoder."
brew install mplayer
fi
echo -e "\033[32m Combining $* into output.avi."
mencoder -really-quiet -of lavf -oac copy -ovc copy -o output.avi $*
while true; do
read -p "Do you want to keep the old files? " yn
case $yn in
[Yy]* ) exit;;
[Nn]* ) rm $*; break;;
* ) echo "Please answer yes or no.";;
esac
done
while true; do
read -p "Do you want to name the output? " yn
case $yn in
[Yy]* ) echo "Name the file (no extension): "; read new_name; mv output.avi $new_name.avi; echo "File renamed to $new_name.avi."; exit;;
[Nn]* ) echo "output.avi written."; exit;;
* ) echo "Please answer yes or no.";;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment