Fraunhofer FDK AAC in FFmpeg

5,823

Solution 1

The FDK-AAC library is determined by FFmpeg to have a license compatible with the LGPL but not the GPL. The most commonly desired add-on to FFmpeg is the GPLed x264 library, so it's rare to find a publicly redistributable ffmpeg binary that has libfdk_aac linked.

However, there is an 'auto-build' script available for Windows which will setup a compiler toolchain, download ffmpeg and many other popular libraries, and compile binaries. It's available at https://github.com/jb-alvarado/media-autobuild_suite

Solution 2

Very briefly:

You can't "add a codec library" to "your" FFmpeg. Instead you have to completely compile your own FFmpeg binary from source. Which is a bit difficult if you've never compiled anything yourself. So it requires understanding the compilation guide, it requires knowledge how to compile stuff on Windows 10, it requires a working C compiler etc. A tutorial about how to do that is probably beyond the scope of this site.

But start with picking a compiler from the four alternatives mentioned in the compilation guide, install that compiler, and compile a "hello world" application. The figure out how the configuration stuff works.

Anyhow, once you can compile ffmpeg somehow, you need to add --enable-libfdk-aac to the configuration options. You'll also need to install (or compile) the libfdk_aac library.

It's possible that somehow already has done this and this library is included in your nightly git build; check with ffmpeg -codecs.

I am not sure I understand the second question, you already seem to know how to encode DTS with the built-in encoder. Also note that unless you have some amplifier that you cannot connect to your PC except by some low-bitrate link where DTS would be necessary, encoding audio in DTS isn't really necessary, and won't produce better quality results than the alternatives.

Share:
5,823

Related videos on Youtube

RvidD
Author by

RvidD

Updated on September 18, 2022

Comments

  • RvidD
    RvidD over 1 year

    The FFmpeg AAC guide says,

    Fraunhofer FDK AAC codec library is currently the highest-quality AAC encoder available with ffmpeg. Pre-built ffmpeg does not support it. This can be resolved by compiling ffmpeg yourself.

    I tried to add it to FFmpeg. But I could not even understand what the Compilation guide tells me to do. So someone please give me instructions step by step to add "FDK AAC codec library" to my FFmpeg. I am using FFmpeg in Windows 10 (64 bit, static, Nightly git).

    Also how do I make DTS audio with FFmpeg? The built-in DTS encoder is experimental and I have to add -strict experimental to encode videos with DTS audio. Is there any complete DTS library available for FFmpeg just like FDK_AAC library?

    • Hashim Aziz
      Hashim Aziz over 3 years
      The mediaautobuild suite linked below is probably the easiest, most complete way to get the FDK-AAC encoder, but if anyone fancies compiling FFmpeg for themselves with FDK-AAC and a few of the most common encoders, I wrote this about a year ago.
  • RvidD
    RvidD over 5 years
    I think it will be really hard for me to compile FFmpeg myself. So is there any alternatives that can do FDK AAC? The second question: I thought the built-in DTS encoder was in beta stage. That's why I asked about a proper DTS encoder.
  • Gyan
    Gyan over 5 years
    There's an auto build script for Windows at github.com/jb-alvarado/media-autobuild_suite which will compile ffmpeg with fdk-aac (among many other external components).
  • dirkt
    dirkt over 5 years
    @Gyan: You should make that an answer.
  • dirkt
    dirkt over 5 years
    The point is that as I mentioned, DTS won't really help unless you have very specific hardware requirements. Which is why nobody is very interested in writing/completing a DTS encoder. Or phrased differently: If you thought "I heard a lot about DTS when reading about audio, so it must be awesome, and I want to use it", then you are doing it wrong.
  • RvidD
    RvidD over 5 years
    @Gyan Just make your comment as an answer for this question. That auto build script is perfect.
  • Otheus
    Otheus almost 5 years
    In some cases (homebrew) you must change the configuration section to also add --enable-nonfree in addition to the --enable-libfdk-aac metnioned above. This is necessary if --enable-gpl was included. Only after this will FDK make into the build