FFmpeg's AAC (“libfaac”) Codec Options?

…衆ロ難τιáo~ 提交于 2019-12-11 18:34:11

问题


For AAC ("libfaac") audio encoder, how can I specify the "MPEG Version" to either "MPEG-4" or "MPEG-2" through FFmpeg's command?


回答1:


When using libfaac, FFmpeg hard-codes the MPEG version to MPEG-4. You can observe this in libfaac.c, line 118.

faac_cfg->mpegVersion = MPEG4;

If you want to change it, you will have download the FFmpeg source, modify this line to use MPEG2 instead, and recompile FFmpeg with the appropriate configuration (including --enable-libfaac). This works and produces a playable file, however you'll obviously have to use a bitstream filter to create a valid bitstream for MPEG-4 containers now:

ffmpeg -i in.wav -c:a libfaac -absf aac_adtstoasc out.m4a

If instead you use the FAAC API directly, you can of course change this parameter as you wish.


Ideally, one would submit a patch for FFmpeg to include a new option which allows you to set this manually, but given that MPEG-4 was chosen as a hardcoded default I don't see a compelling reason to implement this.



来源:https://stackoverflow.com/questions/15133393/ffmpegs-aac-libfaac-codec-options

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!