Skip to content

Instantly share code, notes, and snippets.

@oozoofrog
Last active October 10, 2016 14:31
Show Gist options
  • Save oozoofrog/eb22181d0cd10b1b8434ee9269cd1184 to your computer and use it in GitHub Desktop.
Save oozoofrog/eb22181d0cd10b1b8434ee9269cd1184 to your computer and use it in GitHub Desktop.
multiple codecs and formats convert script with ffmpeg
#!/bin/bash
abort()
{
echo >&2 ' ABORTED '
exit 1
}
trap 'abort' 0
set -e
args=( "$@" )
formats=("avi" "ogg" "wmv" "webm" "vob" "mov" "asf" "amv")
for a in "${args[@]}"; do
for f in "${formats[@]}"; do
filename="${a%.*}"
output="$filename.$f"
echo "ffmpeg -y -i $a $output"
ffmpeg -y -i $a $output
done
done
echo >&2 ' DONE '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment