I'm looking for a well working audio converter which is able to convert audio files (ogg) to mp3 formate. I tried it with the "sound converter" from software center but it stopped converting after 6 of 12 files.
Can anybody here please help me?
I'm looking for a well working audio converter which is able to convert audio files (ogg) to mp3 formate. I tried it with the "sound converter" from software center but it stopped converting after 6 of 12 files.
Can anybody here please help me?
I use ffmpeg
for sound conversion:
ffmpeg -i file.ogg file.mp3
ffmpeg -i file.{ogg,mp3} # if only the extension changes
If your filename contains spaces don’t forget to quote it, e.g.:
ffmpeg -i "file with spaces".{ogg,mp3}
To perform batch processing you can either use a for
loop like
for i in *.ogg; do ffmpeg -i "$i" "${i%.*}.mp3"; done
or – especially for many and/or large files! – GNU parallel
:
parallel ffmpeg -i "{}" "{.}.mp3" ::: *.ogg
This last command will convert every .ogg
file in the current directory to .mp3
efficiently using your CPU(s) to perform multiple tasks in parallel.
To set the audio bitrate ffmpeg
provides the -b:a BITRATE
option, e.g. -b:a 192k
.
If you want to include metadata like title, album and so on, you can use these options:
-map_metadata 0:s:0 -id3v2_version 3 -write_id3v1 1
See man ffmpeg
and this linuxforums.org.uk post for further information.