Difference between revisions of "Libavcodec AAC"

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
(Issues: album art)
m (Minor page reformatting.)
Line 1: Line 1:
 +
{{DISPLAYTITLE:libavcodec AAC}}
 
{{aac-encoders}}
 
{{aac-encoders}}
The multi-codec library, ''libavcodec'', includes an AAC encoder and decoder. The library was created as part of FFmpeg, and forked with Libav. Both projects maintain a separate version of libavcodec.
+
The multi-codec library, '''libavcodec''', includes an '''AAC''' encoder and decoder. The library was created as part of [[FFmpeg]], and forked with Libav. Both projects maintain a separate version of libavcodec.
  
 
The original native AAC encoder was written by Konstantin Shishkov, and released under version 2.1 of the LGPL. It was considered experimental and poor quality compared to non-free/commercial encoders, but at least free. For GSoC 2015, Claudio Freire and Rostislav Pehlivanova did a significant amount of work on the AAC encoder that would be included in FFmpeg 3.0 (February 2016), and FFmpeg has declared this encoder stable (at least for CBR) and ready for common use. Libav has not merged this new work, and continues to use the original experimental encoder.  
 
The original native AAC encoder was written by Konstantin Shishkov, and released under version 2.1 of the LGPL. It was considered experimental and poor quality compared to non-free/commercial encoders, but at least free. For GSoC 2015, Claudio Freire and Rostislav Pehlivanova did a significant amount of work on the AAC encoder that would be included in FFmpeg 3.0 (February 2016), and FFmpeg has declared this encoder stable (at least for CBR) and ready for common use. Libav has not merged this new work, and continues to use the original experimental encoder.  
Line 11: Line 12:
 
* libaacplus, the very old Coding Technologies HE-AAC[v2] encoder. (support removed in FFmpeg 3.0)
 
* libaacplus, the very old Coding Technologies HE-AAC[v2] encoder. (support removed in FFmpeg 3.0)
  
== Sample Rates ==
+
== Sample rates ==
;FFmpeg 3.0+:Supports sample rates for input of 7350, 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, and 96000 Hz.  
+
===FFmpeg 3.0+===
 +
Supports sample rates for input of 7350, 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, and 96000 Hz.  
  
== Channel Layouts ==
+
== Channel layouts ==
 
+
===FFmpeg 3.0+===
;FFmpeg 3.0+:
+
 
{| class="wikitable"
 
{| class="wikitable"
 
! Channels !! Layout !! Description
 
! Channels !! Layout !! Description
Line 39: Line 40:
 
==Issues==
 
==Issues==
 
===Gapless decoding support===
 
===Gapless decoding support===
:''See [[Gapless playback]] for more on the general topic.''
+
{{main|Gapless playback}}
 +
 
 
AAC encoding groups samples into frames of 512/1024/2048 samples. There may be padding of extra samples at the start, due to encoder delay, or at the end if there less than the exact number or samples needed to fill a frame. These extra samples will be decoded as additional silence if they are not trimmed. AAC provides no way to signal how many samples need to be trimmed, so this information is stored in the container, likely in the mp4 iTunSMPB atom.
 
AAC encoding groups samples into frames of 512/1024/2048 samples. There may be padding of extra samples at the start, due to encoder delay, or at the end if there less than the exact number or samples needed to fill a frame. These extra samples will be decoded as additional silence if they are not trimmed. AAC provides no way to signal how many samples need to be trimmed, so this information is stored in the container, likely in the mp4 iTunSMPB atom.
* FFmpeg's decoder will trim from the beginning, but not the end
+
* FFmpeg's decoder will trim from the beginning, but not the end.
* Libav's decoder will not trim at all
+
* Libav's decoder will not trim at all.
 +
 
 
===Embedded album art===
 
===Embedded album art===
 
Album art embedding is not supported the same way it is for MP3. Use -vn if the source file contains album art, or it will try to convert it to MP4 video and fail.
 
Album art embedding is not supported the same way it is for MP3. Use -vn if the source file contains album art, or it will try to convert it to MP4 video and fail.
  
 
== External links ==
 
== External links ==
* [https://en.wikipedia.org/wiki/Libavcodec libavcodec] at Wikipedia
 
 
* [https://trac.ffmpeg.org/wiki/Encode/AAC#fdk_aac FFmpeg AAC encoding guide]
 
* [https://trac.ffmpeg.org/wiki/Encode/AAC#fdk_aac FFmpeg AAC encoding guide]
 
* [https://wiki.libav.org/Encoding/aac Libav AAC encoders]
 
* [https://wiki.libav.org/Encoding/aac Libav AAC encoders]
 +
* {{wikipedia|libavcodec}}
  
 
[[Category:Encoder/Decoder]]
 
[[Category:Encoder/Decoder]]

Revision as of 18:07, 15 October 2018

Current AAC encoders
(most to least recommended)
1 Apple AAC M/W
2 FhG AAC (Winamp) W
3 Fraunhofer FDK AAC S/L/M/W
4 Nero AAC L/W
5 FFmpeg 3.0+ AAC encoder S/L/M/W
6 FAAC S/L/M/W
7 Libav (pre-3.0 FFmpeg) AAC encoder S/L/M/W
S Source code available; L Linux; M macOS; W Windows
List of AAC encoders

The multi-codec library, libavcodec, includes an AAC encoder and decoder. The library was created as part of FFmpeg, and forked with Libav. Both projects maintain a separate version of libavcodec.

The original native AAC encoder was written by Konstantin Shishkov, and released under version 2.1 of the LGPL. It was considered experimental and poor quality compared to non-free/commercial encoders, but at least free. For GSoC 2015, Claudio Freire and Rostislav Pehlivanova did a significant amount of work on the AAC encoder that would be included in FFmpeg 3.0 (February 2016), and FFmpeg has declared this encoder stable (at least for CBR) and ready for common use. Libav has not merged this new work, and continues to use the original experimental encoder.

Alternatives

The FFmpeg/Libav frameworks can also use other encoding libraries, if they are available.

  • Fraunhofer FDK AAC, via libfdk-aac. Both frameworks recommend using this encoder if it is available, but it is non-free.
  • FAAC, via libfaac.
  • libvo-aacennc, the very poor VisualOn AAC encoder. (support removed in FFmpeg 3.0)
  • libaacplus, the very old Coding Technologies HE-AAC[v2] encoder. (support removed in FFmpeg 3.0)

Sample rates

FFmpeg 3.0+

Supports sample rates for input of 7350, 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, and 96000 Hz.

Channel layouts

FFmpeg 3.0+

Channels Layout Description
1 C Mono
2 L+R Stereo
3 C, L+R
4 C, L+R, B
5 C, L+R, BL+BR
5.1 C, L+R, BL+BR, LFE
7.1 C, FL+FR, SL+SR, BL+BR, LFE

The plus sign (+) denotes paired "stereo" channels.

Issues

Gapless decoding support

Main article: Gapless playback

AAC encoding groups samples into frames of 512/1024/2048 samples. There may be padding of extra samples at the start, due to encoder delay, or at the end if there less than the exact number or samples needed to fill a frame. These extra samples will be decoded as additional silence if they are not trimmed. AAC provides no way to signal how many samples need to be trimmed, so this information is stored in the container, likely in the mp4 iTunSMPB atom.

  • FFmpeg's decoder will trim from the beginning, but not the end.
  • Libav's decoder will not trim at all.

Embedded album art

Album art embedding is not supported the same way it is for MP3. Use -vn if the source file contains album art, or it will try to convert it to MP4 video and fail.

External links