"The %s '%s' is experimental but experimental codecs are not enabled, "
"add '-strict %d' if you want to use it.\n"
With a simple google search (no more than 15mins) I couldn’t find a way to enable native FFMPEG AAC encoding, on the command line you do it by adding this: -strict experimental or -strict -2 however, it wasn’t clear to me how to do it on your own code (when using libavcodec and libavformat) so I followed that flag and determined that this message gets thrown when your codec context
avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL
So to the equivalent of adding the -strict experimental on the command line in code would be setting your codec context variable: strict_std_complaince to -2 before opening the codec.
c->strict_std_compliance = -2;
/* open it */
ret = avcodec_open2(c, codec, NULL);