"The encoder 'aac' is experimental but experimental codecs are not enabled"

Ffmpeg

Ffmpeg Problem Overview


While converting flv to mp4 conversion using FFMPEG it's showing following error

> [aac @ 0x2b4b640] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

Ffmpeg Solutions


Solution 1 - Ffmpeg

Actually it is not enough to add -strict -2 to the command line. It is very important where the -strict -2 is added and unfortunately this is not explained in the error message. It should be just before the last argument, that is, as follows:

ffmpeg -i infile -strict -2 outfile

Solution 2 - Ffmpeg

Like the message says, the native ffmpeg AAC audio encoder is experimental and you need to add -strict -2 or -strict experimental to your command use it. However, this encoder is no longer marked as experimental, so recent ffmpeg builds do not need to use this option.

For the best results use libfdk_aac instead. You need to compile ffmpeg with this lib, see the compilation guide.

To set the audio encoder use -c:a libfdk_aac.

Solution 3 - Ffmpeg

Try following command :

ffmpeg -i Inputfile.flv -vcodec h264 -acodec aac -strict -2 Filename.mp4

You can use this command to convert any type of video file into mp4 with x264 and with same quality.

I have tried so many ways but this worked for me like a charm. ;)

Solution 4 - Ffmpeg

You can add the -strict experimental in your C++ code by setting the codec-context strict_std_complaince variable to -2 before opening the codec.

AVCodecContext *c;
c->strict_std_compliance = -2;

/* open it */
ret = avcodec_open2(c, codec, NULL);

See the original author's explanation here.

Solution 5 - Ffmpeg

Your question answers itself. Add -strict -2 to it. That should be enough

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSandeep NambiarView Question on Stackoverflow
Solution 1 - FfmpegfreeseekView Answer on Stackoverflow
Solution 2 - FfmpegaergistalView Answer on Stackoverflow
Solution 3 - FfmpegRavi GohilView Answer on Stackoverflow
Solution 4 - FfmpegDumisani KuneneView Answer on Stackoverflow
Solution 5 - FfmpegAkhil GuptaView Answer on Stackoverflow