Ffmpeg FLAC to AAC encoding

aacaudioencodingffmpegflac

I wanted to make sure that I'm not shooting myself in the foot and ask about this.
So currently I have an audio file in a .mkv container that looks like this

Audio: FLAC (framed) 48000Hz stereo 1536kbps [A: Audio (flac, 48000 Hz, stereo, s16) [default]]

ID : 2
Format : FLAC
Format/Info : Free Lossless Audio Codec
Codec ID : A_FLAC
Duration : 39mn 50s
Bit rate mode : Variable
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Title : Audio
Writing library : libFLAC 1.2.1 (UTC 2007-09-17)

And I would like to convert it to AAC, preferably without losing the quality too much.
I did find a similar question asked on this forum.
But the method that was described there is about 3 years old.

In short:

"compile your own ffmpeg for fdk_aac
follow the AAC encoding guide and use fdk_aac's -vbr option – with a setting of 3"

Resulting in:

ffmpeg -i input.flac -c:a libfdk_aac -vbr 3 output.m4a".

By evilsoup. – taken from here.

So I was wondering if this will work for my situation, or if it won't work for me.
If that's all it takes then no need to answer, and thanks!

Best Answer

FFmpeg supports two AAC-LC encoders:

  • Native FFmpeg AAC encoder (aac)
  • Fraunhofer FDK AAC (libfdk_aac)

FFmpeg supports one HE-AAC encoder:

  • Fraunhofer FDK AAC (libfdk_aac)

libfdk_aac

libfdk_aac is still the best AAC-LC encoder supported by FFmpeg, and is the only HE-AAC encoder supported by FFmpeg. However, its license is problematic when it comes to distribution, so you'll need to compile ffmpeg to be able to use it.

Native FFmpeg AAC encoder

This encoder has seen many improvements since the answer you refer to. It is no longer considered experimental, but it is not yet as good as libfdk_aac. However, if you give it enough bits it should be acceptable. The advantage of this encoder is that it is always available and comes with FFmpeg.

Pipe

Not always practical, but you can pipe to your favorite, standalone encoder:

ffmpeg -i input -f wav - | fdkaac -I -m 5 - -o output.m4a

Also see

Related Question