FFmpeg的AAC(“libfaac”)编解码器选项? [英] FFmpeg's AAC ("libfaac") Codec Options?
问题描述
对于AAC(libfaac)音频编码器,如何通过FFmpeg的命令将MPEG版本指定为MPEG-4或MPEG-2?
For AAC ("libfaac") audio encoder, how can I specify the "MPEG Version" to either "MPEG-4" or "MPEG-2" through FFmpeg's command?
推荐答案
使用libfaac时,FFmpeg将MPEG版本硬编码为MPEG-4。你可以在 libfaac.c
,第118行观察。
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;
如果要更改它,您将下载FFmpeg源,修改此行以使用 MPEG2
,并用适当的配置重新编译FFmpeg(包括 - enable-libfaac
)。这可以起作用并产生一个可播放的文件,但是您显然必须使用比特流筛选器来为MPEG-4容器创建有效的比特流:
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
如果您直接使用FAAC API,您可以根据需要更改此参数。
If instead you use the FAAC API directly, you can of course change this parameter as you wish.
理想情况下,一个将提交FFmpeg的补丁以包含一个新的选项,允许您手动设置,但是鉴于MPEG-4被选为硬编码的默认值,我看不到令人信服的理由来实现。
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.
这篇关于FFmpeg的AAC(“libfaac”)编解码器选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!