Php-ffmpeg “Unknown encoder libfaac” on Windows

I just had the some problem, but solved it by defining a new audio-codec in the constructor. Instead of this line in the question...

$format = new FFMpeg\Format\Video\X264();

I used...

$format = new FFMpeg\Format\Video\X264('libmp3lame', 'libx264');

The required library is not included due to licensing.

Zeranoe FFmpeg - Why dont the builds include FAAC, FDK-AAC, libaacplus?

These libraries are not compatible with the GPL license and cannot be included without licensing the build as nonfree. A nonfree build cannot be publicly distributed.

You have the following solutions:

  1. Use another audio codec instead of AAC. There's a LAME MP3 encoder for example.
  2. Compile your own version of FFmpeg adding all the libraries you want See FFmpeg Compilation Guide