I have a few hundreds wma files that I would like to convert to a different format, mainly because my entire library consists of mp3, aac, or m4a, so all compatible with Apple portable devices, and I use iTunes as interface with these devices. So I know that ffmpeg, realplayer, mediamonkey, itunes all can convert wma to other formats, but my question is (i) what would be best "workflow" to minimize quality loss and (ii) what target format/codec to use. And yes, I know that lossless to lossless is generally not a good idea, and that I probably will have some deterioration, but I try to find the best method. I could think of:

  1. straight conversion using ffmpeg (but what settings to use? would it help to use 192 kbps or higher, or is this pointless, and it would be better to actually use exactly the same bitrate as the original file, i.e. 128 kbps? Quid sampling rate, also 44.1 or higher?

  2. convert through an intermediate format (wav or flac), so in a first step all possible audio info is extracted, and then in a second step encoded again.

  3. I am neutral between mp3 or m4A (or aac, but I understood this is just a different file-extension for the same codec?), so would it make a difference to convert the wma to either of them? (I am aware of a specific mp3 vs m4a question here, so my question is really related to having wma as a sourcefile.

The wma files have the following properties: Windows Media Audio V8 - 128 kbps, 44.1 kHz, 2 channels, 16 bits

up vote 2 down vote accepted

Use a good encoder implementation with sane encoding options. Then experiment to see what is acceptable for you.

AAC using libfdk_aac

This is the best AAC encoder supported by ffmpeg. However, it is considered incompatible with the GPL, so you'll have to compile it (although you may be able to find a build [that is violating the GPL]). VBR example:

ffmpeg -i input.wma -c:a libfdk_aac -vbr 5 output.m4a

AAC using native FFmpeg AAC encoder

The native FFmpeg AAC encoder is decent, but you'll need to give it enough bits to sound as good as libfdk_aac. Experiment with the bitrate (-b:a) value to get something acceptable for you. CBR example (VBR is not as good yet):

ffmpeg -i input.wma -c:a aac -b:a 192k output.m4a

If your ffmpeg complains about this encoder being "experimental" then it is out of date and you should update.

MP3 using libmp3lame

For MP3 your best choice is libmp3lame. VBR example:

ffmpeg -i input.wma -c:a libmp3lame -q:a 2 output.mp3

Also see


Q & A

Straight conversion using ffmpeg?

Yes. ffmpeg can decode just about anything, it can preserve the metadata, it supports many encoders and formats, you can control what it does, and you can put it in a loop to encode all files in a directory (that part requires simple scripting).

But what settings to use? Would it help to use 192 kbps or higher, or is this pointless?

It depends on the encoder and if you want VBR or CBR. See the "Also see" links for more information, details, and examples.

Would be better to actually use exactly the same bitrate as the original file, i.e. 128 kbps?

I often see users trying to do this, but re-using the same bitrate is not optimal. How do you know that whoever encoded the originals knew what they were doing? How do you know that the encoder itself was crappy or not? Different encoders vary in efficiency. The difference in each format itself is important to consider. Also, when it comes to a re-encoding a lossy input you should note that the file is different the the original: data has been mangled and it includes artifacts not present in the original, so even if using the same encoder and the same bitrate it would have to re-encode these artifacts because they are part of the file, resulting in a worse output.

Quid sampling rate, also 44.1 or higher?

Don't worry about sampling rate. ffmpeg will use the same rate as the input.

Convert through an intermediate format (wav or flac), so in a first step all possible audio info is extracted, and then in a second step encoded again?

This is an unnecessary step. ffmpeg will completely decode the audio into raw PCM audio anyway, so there is no need to do so beforehand.

I am neutral between mp3 or m4A (or aac, but I understood this is just a different file-extension for the same codec?), so would it make a difference to convert the wma to either of them? (I am aware of a specific mp3 vs m4a question here, so my question is really related to having wma as a sourcefile.)

It does not matter that the source is WMA. Use whatever output format is better supported by your preferred device or software. I believe Apple products supports both MP3 and AAC, and I'm guessing AAC audio in M4A container is what it uses in the "library", so I would likely use that combination.

  • Thanks for your reply. Maybe just a final precision, as you did not explicitly mention this. Would it not bring any (quality) benefit to first convert to wav, and then to encode to aac ? – Peter K. Jan 10 '17 at 9:13
  • @PeterK. I added answers for the missing questions. There were so many that I forgot the rest. – llogan Jan 10 '17 at 17:51

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.