I first tried the approved ffmeg. That one helped me many times with good results.
Version 1:
find -name '*wma' -exec ffmpeg -i {} -acodec vorbis -ab 128k {}.ogg \;or
rename 's/\.wma//' *\.wma\.ogg
(Test the renameing: rename --no-act --verbose 's/\.wma//' *\.wma\.ogg)
Version 2:
for i in *.wma; do ffmpeg -i "$i" -vn -acodec vorbis -ab 128k "${i/.wma}".ogg; done# ffmpeg: -vn => novideo, -acodec vorbis => ogg-encoder, -ab set audio bitrate to 128k (64 is standard. That option doesn't seem to work with ogg :-(
# ${i/.wma} is cutting the filename $i from ".wma"
The quality gets really worse.
Best quality with version 3:
1. Step: Convert wma to flac with ffmeg
ffmpeg -i input.wma -vn -acodec flac output.flac
2. Step: Convert flac to ogg with oggenc
oggenc input.flac -q2 -o output.ogg# -q quality 2 (1 bad .. 10 excellent)
# -o output-file
Or all in one line to convert the whole directory:
for i in *.wma; do ffmpeg -i "$i" -vn -acodec flac -y tmp.flac; oggenc tmp.flac -q2 -o "${i/.wma}".ogg; done; rm -f tmp.flac# -y Overwrite output files.
# rm -f delete without further questions