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
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
Q & A
Straight conversion using
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.