Changes between Version 3 and Version 4 of Encode/AAC


Ignore:
Timestamp:
Jan 12, 2013, 3:51:13 AM (7 years ago)
Author:
llogan
Comment:

add more encoders

Legend:

Unmodified
Added
Removed
Modified
  • Encode/AAC

    v3 v4  
    33[[PageOutline(2-3, Contents)]]
    44
    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
     7FFmpeg 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----
    610
    711== libfdk_aac ==#fdk_aac
     
    6367}}}
    6468
    65 Convert the video with [[x264EncodingGuide#twopass|libx264]], with a target of fitting a 90-minute movie on a 700MB(=5734400kb) CD-ROM, mixing the audio down to two channels (WIndows users should use `NUL` rather than `/dev/null`:
     69Convert the video with [[x264EncodingGuide#twopass|libx264]], with a target of fitting a 90-minute movie on a 700MB(=5734400kb) CD-ROM, mixing the audio down to two channels (Windows users should use `NUL` rather than `/dev/null`):
    6670
    6771{{{
     
    7781Unfortunately, many devices that can play AAC-LC (the default profile for fdk_aac) simply cannot play either version of AAC-HE, so this is not recommended for surround sound audio, which normally needs to be compatible with such hardware players. If you are only going to play it on your computer, or you are sure that your hardware player supports AAC-HE, you can aim for a bit rate of 160kb/s for version 1, or 128kb/s for version 2. As always, experiment to see what works for your ears.
    7882
    79 The following examples are taken from [[http://ubuntuforums.org/showpost.php?p=12421935&postcount=34|this ubuntuforum post]].
     83The following examples are taken from [[http://ubuntuforums.org/showpost.php?p=12421935&postcount=34|this ubuntuforums post]].
    8084
    8185==== AAC-HE version 1 ====
     
    9195}}}
    9296
    93 == ffmpeg AAC ==
     97----
    9498
    95 If your version of ffmpeg isn't built with `--enable-libfdk_aac`, you can use ffmpeg's internal AAC encoder. Note that you will not get as good results as with fdk_aac.
     99== Native FFmpeg AAC encoder ==
     100
     101The native FFmpeg AAC encoder is included with ffmpeg and is does not require an external library like the AAC encoders described here. Note that you will not get as good results as with libfdk_aac. The `-cutoff` option may improve quality according to [http://d.hatena.ne.jp/kamedo2/20120729/1343545890 Quality Assessment of FFmpeg AAC]. This encoder does not currently work with `-q:a`/`-qscale:a` (see ticket #[ticket:1346]).
    96102
    97103==== Example ====
    98104
    99105{{{
    100 ffmpeg -i input.wav -strict experimental -c:a aac -b:a 128k output.m4a
     106ffmpeg -i input.wav -strict experimental -c:a aac -cutoff 15000 -b:a 128k output.m4a
    101107}}}
     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{{{
     117ffmpeg -i input.wav -c:a libvo_aacenc -b:a 128k output.m4a
     118}}}
     119
     120----
     121
     122== libfaac ==
     123
     124Freeware Advanced Audio Coder. Requires ffmpeg configuration with the ironic options of `--enable-libfaac --enable-nonfree`.
     125
     126==== VBR Example ====
     127{{{
     128ffmpeg -i input.wav -c:a libfaac -q:a 100 output.m4a
     129}}}
     130
     131Range for `-q:a` is 0-250 and is similar to using the `-q` option in standalone `faac`.
     132
     133==== CBR Example ====
     134{{{
     135ffmpeg -i input.wav -c:a libfaac -b:a 128k output.m4a
     136}}}
     137
     138----
     139
     140== Metadata ==
     141You can add metadata to any of the examples on this guide:
     142
     143{{{
     144ffmpeg -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
     152It 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
     156It 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
     159todo:
     160Find 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
     162List available metadata options for the MP4 container.
     163}}}