"The encoder 'aac' is experimental but experimental codecs are not enabled"
Solution 1
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
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
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
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.
Related videos on Youtube
![Sandeep Nambiar](https://i.stack.imgur.com/XR9db.jpg?s=256&g=1)
Comments
-
Sandeep Nambiar almost 3 years
While converting
flv
tomp4
conversion usingFFMPEG
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.
-
llogan over 6 yearsIf you're seeing the "experimental" message then your
ffmpeg
is old. The FFmpeg AAC encoder is no longer experimental so you don't need to use-strict experimental
/-strict -2
anymore. See the FFmpeg Download page for links to builds for Linux, macOS, and Windows. -
Sebastian Iorga over 5 yearsAs of this comment Ubuntu 16.04 LTS is providing version 7:2.8.15-0ubuntu0.16.04.1 which still triggers the "experimental" error. Assuming you're just using the apt package.
-
-
llogan over 8 years@SandeepNambiar "You need to compile ffmpeg with this lib, see the compilation guide." Also, you should accept one of these answers; the
Unknown encoder 'libfdk_aac'
is a different issue than what your question asks about. -
Mike Versteeg over 8 yearsWhen making an advice like this it is good form to mention that codec is not GPL (basically that means you cannot use it without paying for it). See trac.ffmpeg.org/wiki/Encode/AAC
-
aergistal over 8 years@Mike Versteeg In this case there is nothing in the question that indicates the asker wants to distribute the code and there are no license fees for distributing AAC content. Plus it's not an advice. See: vialicensing.com/licensing/aac-faq.aspx
-
Brian FitzGerald about 8 yearsThanks a lot for this, these zero byte files (because of incorrect flag order) had me baffled.
-
coderMe over 7 yearsAs @freeseek mentioned, this is not enough - it is very important exactly where you place the
-strict -2
flags. -
Akhil Gupta over 7 yearsI felt that would be obvious, like freeseek mentioned, before the output file name
-
coderMe over 7 yearsIf it's so obvious, why the original question at all?
-
Kalob Taulien over 6 yearsI was encoding videos from mp4 to hls and kept getting the aac/strict 2 error message. freeseek's answer was the only one that worked.
-
brillout over 6 yearsYou saved my file/life. Goddamn ffmpeg should get their params fixed
-
Mitya over 5 yearsCrazy that they don't point this out in the logs. Thanks, @freeseek, really helped me out.
-
YTZ over 3 years"It should be just before the last argument" is incorrect. You can do something like this
ffmpeg -i infile -c:a aac -strict 2 -ab 192k outfile
without any problems. -
Navin about 2 years@brillout ffmpeg is known for its insane/idiosyncratic syntax. This hasn't been fixed in 2022 and I doubt it ever will be.