Skip to content

Instantly share code, notes, and snippets.

@elleryq
Created October 12, 2017 14:03
Show Gist options
  • Save elleryq/5f855f2b45e31273cd6a5810e20e0bc4 to your computer and use it in GitHub Desktop.
Save elleryq/5f855f2b45e31273cd6a5810e20e0bc4 to your computer and use it in GitHub Desktop.
Convert webm/mkv to mp3
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for f in $(find . -regex '.*\(webm\|mkv\)$' -print)
do
fn=$(basename "${f}")
extension="${fn##*.}"
f="${fn%.*}"
ffmpeg -i "${fn}" ${f}.mp3
done
IFS=$SAVEIFS
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment