0

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?

RvidD
  • 364
  • 2
  • 4
  • 12
  • 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](https://superuser.com/questions/1425350/how-to-compile-the-best-version-of-ffmpeg-for-windows/1425351#1425351) about a year ago. – Hashim Aziz Dec 17 '20 at 20:39

2 Answers2

2

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

Gyan
  • 34,439
  • 6
  • 56
  • 98
1

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.

dirkt
  • 16,421
  • 3
  • 31
  • 37
  • 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. – RvidD Oct 16 '18 at 06:37
  • 1
    There's an auto build script for Windows at https://github.com/jb-alvarado/media-autobuild_suite which will compile ffmpeg with fdk-aac (among many other external components). – Gyan Oct 16 '18 at 06:39
  • @Gyan: You should make that an answer. – dirkt Oct 16 '18 at 06:43
  • 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. – dirkt Oct 16 '18 at 06:46
  • @Gyan Just make your comment as an answer for this question. That auto build script is perfect. – RvidD Oct 18 '18 at 16:32
  • 1
    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 – Otheus May 24 '19 at 09:01