| 5 | | [[http://en.wikipedia.org/wiki/Advanced_Audio_Coding|AAC, Advanced Audio Coding]], is the successor format to MP3, and is defined in MPEG-4 part 3. It is often used within an MP4 container format, for music the .m4a extension is customarily used. The second-most common use is within matroska MKV files (used because it has better support for embedded text-based soft subtitles than MP4). The examples in this guide will use the extensions MP4 and M4A. |
| | 5 | [[http://en.wikipedia.org/wiki/Advanced_Audio_Coding|AAC, Advanced Audio Coding]], is the successor format to MP3, and is defined in MPEG-4 part 3. It is often used within an MP4 container format, for music the .m4a extension is customarily used. The second-most common use is within MKV (Matroska) files because it has better support for embedded text-based soft subtitles than MP4. The examples in this guide will use the extensions MP4 and M4A. |
| | 6 | |
| | 7 | FFmpeg can support four AAC-LC encoders (`aac`, `libfaac`, `libfdk_aac`, `libvo_aacenc`) and two AAC-HC encoders (`libaacplus` and `libfdk_aac`). `libaacplus`, `libfaac`, and `libfdk_aac` are considered "non-free", and are therefore non-redistributable meaning you may have trouble finding a build that supports these. Of course you can resolve this by [[CompilationGuide|compiling ffmpeg]]. |
| | 8 | |
| | 9 | ---- |
| | 108 | |
| | 109 | ---- |
| | 110 | |
| | 111 | == libvo_aacenc == |
| | 112 | |
| | 113 | !VisualOn AAC encoding library. Requires ffmpeg configuration with `--enable-libvo-aacenc`. This has the advantage of not being non-free, and is included by some distributors, but is a rather poor encoder compared to libfdk_aac and even the native FFmpeg AAC encoder according to [http://d.hatena.ne.jp/kamedo2/20120729/1343545890 Quality Assessment of FFmpeg AAC]. |
| | 114 | |
| | 115 | ==== Example ==== |
| | 116 | {{{ |
| | 117 | ffmpeg -i input.wav -c:a libvo_aacenc -b:a 128k output.m4a |
| | 118 | }}} |
| | 119 | |
| | 120 | ---- |
| | 121 | |
| | 122 | == libfaac == |
| | 123 | |
| | 124 | Freeware Advanced Audio Coder. Requires ffmpeg configuration with the ironic options of `--enable-libfaac --enable-nonfree`. |
| | 125 | |
| | 126 | ==== VBR Example ==== |
| | 127 | {{{ |
| | 128 | ffmpeg -i input.wav -c:a libfaac -q:a 100 output.m4a |
| | 129 | }}} |
| | 130 | |
| | 131 | Range for `-q:a` is 0-250 and is similar to using the `-q` option in standalone `faac`. |
| | 132 | |
| | 133 | ==== CBR Example ==== |
| | 134 | {{{ |
| | 135 | ffmpeg -i input.wav -c:a libfaac -b:a 128k output.m4a |
| | 136 | }}} |
| | 137 | |
| | 138 | ---- |
| | 139 | |
| | 140 | == Metadata == |
| | 141 | You can add metadata to any of the examples on this guide: |
| | 142 | |
| | 143 | {{{ |
| | 144 | ffmpeg -i input ... -metadata author="FFmpeg Bayou Jug Band" -metadata title="Decode my Heart" output.mp4 |
| | 145 | }}} |
| | 146 | |
| | 147 | ---- |
| | 148 | |
| | 149 | == FAQ == |
| | 150 | === Which encoder should I use? What provides the best quality? === |
| | 151 | |
| | 152 | It depends. For AAC-LC the likely answer is: libfdk_aac > libfaac > FFmpeg AAC ≥ libvo_aacenc. |
| | 153 | |
| | 154 | === Should I use AAC-LC or AAC-HE? === |
| | 155 | |
| | 156 | It also depends. If you require a low audio bitrate, such as ≤ 32kbs/channel, then AAC-HE would be worth considering depending if your player or device can support AAC-HE decoding. Anything higher may benefit more from AAC-LC due to less processing. If in doubt use AAC-LC. |
| | 157 | |
| | 158 | {{{#!comment |
| | 159 | todo: |
| | 160 | Find out if libfdk_aac and libaacplus can be installed/supported at the same time. I can't remember. If not then add error(s) and any trac ticket # to FAQ and/or each encoder's section. |
| | 161 | |
| | 162 | List available metadata options for the MP4 container. |
| | 163 | }}} |