Skip to content

Instantly share code, notes, and snippets.

@the-eric-kwok
Created May 12, 2018 13:26
Show Gist options
  • Save the-eric-kwok/4afbc70ca4d99dc1b7a79d2a73827c06 to your computer and use it in GitHub Desktop.
Save the-eric-kwok/4afbc70ca4d99dc1b7a79d2a73827c06 to your computer and use it in GitHub Desktop.
Merge video and audio
#!/bin/bash
VIDEO=$1
AUDIO=$2
OUTPUT=$3
help(){
echo "Usage: burn_ass.sh <video> <ass sub> <output>"
}
burn(){
ffmpeg -i ${VIDEO} -i ${AUDIO} -c:v copy ${OUTPUT}
}
install(){
sudo apt-get install ffmpeg
}
dpkg -l | grep 'ffmpeg' > /dev/null
FFMPEG=$?
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then
help
elif [ ${FFMPEG} ]; then
burn
else
echo "ffmpeg not found, installing..."
install
burn
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment