Skip to content

Instantly share code, notes, and snippets.

@simon04
Created February 15, 2015 17:39
Show Gist options
  • Save simon04/33187c6849fd9c10ca47 to your computer and use it in GitHub Desktop.
Save simon04/33187c6849fd9c10ca47 to your computer and use it in GitHub Desktop.
Converts m4a files to Ogg Vorbis using ffmpeg
#!/bin/bash
# Author: Simon Legner <[email protected]>
convert () {
in="$1"
out="${in%.m4a}.ogg"
ffmpeg -i "$in" \
-acodec libvorbis -aq 4 -vn -ac 2 \
-map_metadata 0 \
"$out"
}
if [[ $# == 0 ]]; then
echo Converts m4a files to Ogg Vorbis using ffmpeg.
echo Usage: $0 file1.m4a file2.m4a ... fileN.m4a
echo ... produces file1.ogg file2.ogg ... fileN.ogg
fi
for i in "$@"; do
convert "$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment