Skip to content

Instantly share code, notes, and snippets.

@haansn08
Created April 5, 2015 13:14
Show Gist options
  • Save haansn08/974398cd5f51e26b892d to your computer and use it in GitHub Desktop.
Save haansn08/974398cd5f51e26b892d to your computer and use it in GitHub Desktop.
Bash audio converter using ffmpeg
#!/bin/bash
find "$1" -name *.$2 | while read filename
do
newdir="$3"/${filename#*/}
newpath=${newdir%/*}
mkdir -p "$newpath"
newext=${newdir%.$2}.$4
ffmpeg -i "$filename" -vn "$newext" < /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment