Перейти к содержимому

Aac fdk или lav в чем разница

  • автор:

Difference between AAC (lav) and AAC (Fraunhofer) audio codec?

pxstein is offline

Member Join Date Jan 2011 Search PM

In most of the video converters users can choose between two AAC codecs/encoders:
— (default) AAC (lav)
and
— Fraunhofer AAC

Is there a significant difference between them?

In particular I am interested if there is a negative impact on (later) keyframe-oriented cutting and on audio-video syncing

hello_hello is offline

Member Join Date Mar 2012 Search PM

I’m guessing, but I think AAC (lav) is probably the native ffmpeg encoder. Of the freely available encoders, it’s probably the lowest quality, although they’re all quite good at decent bitrates.
Fraunhofer AAC is probably the encoder supplied with the last version of WinAMP. It should be quite good.

QAAC is considered to be one of the best, if not the best, AAC encoder. It uses the Apple itunes encoder. If you have itunes installed you can download and run QAAC. If you don’t, you can download the full/offline itunes installer and extract the necessary files. There’s no need to install itunes.

All lossy encoders use frames, so the audio has to be cut on an audio frame, but any decent muxing program would add an appropriate audio delay after removing an audio frame when cutting, assuming it’s necessary. The length of an audio frame is quite small.
Lossy encoders also add padding to the beginning and end of the audio. Usually for AAC, information is saved to the MP4/M4A container so players can skip the padding (gapless playback). If that information is present, MKVToolNix will use it to remove the padding and/or automatically apply an audio delay to compensate so the AV sync remains exact.

QAAC is the only encoder (as far as I know) with an option to not pad the beginning of the audio with silence. The command line argument is —no-delay.

Here’s a link for a version of foobar2000 I uploaded a while back.
foobar2000 portable (for audio encoding)
It’s a portable version so you can just unzip and run it. It’s ready to go for encoding with the freely available AAC encoders, and it comes with conversion and encoder presets for converting just about any format to any format. About the only thing you need to do is download and put ffmpeg in the encoders folder for decoding/encoding some audio types. The necessary files for encoding with QAAC are included. There’s also conversion and DSP presets for downmixing and/or compression. It’s a year or so old now, but everything runs on XP.

Some links
QAAC
I think the current makeportable2.cmd file for extracting the required files from the itunes installer is here, if you want to update the encoder to the latest version, or the 64 bit version, at some stage.

Что за форматы AAC (Faac) и AAC (Lav)

Первый AAC | FAAC (Freeware Advanced Audio Сoder), а второй не встречал.

Похожие вопросы

Ваш браузер устарел

Мы постоянно добавляем новый функционал в основной интерфейс проекта. К сожалению, старые браузеры не в состоянии качественно работать с современными программными продуктами. Для корректной работы используйте последние версии браузеров Chrome, Mozilla Firefox, Opera, Microsoft Edge или установите браузер Atom.

Aac fdk или lav в чем разница

Начиная с v2.6.9 ОС Windows XP не поддерживается! Но всё может быть

* Win32 and Win64 builds are now using winbuilds.org, Xp no longer supported.

Скрипт для создания портабельной копии Avidemux Win32/Win64/VsWin64 (exe/zip) — admport.cmd (для его работы нужен 7-Zip в — в скрипте стоит проверка его наличия). На VsWin64 будет ругаться 7-Zip — это ложная тревога.Если запустить скрипт с ключом -h | —help выведется встроенная справка. admp.cmd — переписанный admport.cmd — использует cURL и 7-Zip, сам найдёт, скачает и распакует последнюю доступную «ночнушку», после запустит результат (переделки под PowerShell не будет!).

Надо бы по идее глянуть этот ААС — что там внутри да как, ну работает и лады. Успеем глянуть.

———-
Жив курилка! (Р. Ролан, «Кола Брюньон»)
Xeon E5 2697v2/C602/128 GB PC3-14900L/GTX 1660 Ti, Xeon E5-2697v2/C602J/128 Gb PC3-14900L/GTX 1660 Ti

Fraunhofer FDK AAC ( libfdk_aac )

The Fraunhofer FDK AAC codec library. This is currently the highest-quality AAC encoder available with ffmpeg (except on macOS, see below). Requires ffmpeg to be configured with —enable-libfdk-aac (and additionally —enable-nonfree if you’re also using —enable-gpl ).

Detailed information about the FDK AAC library (not FFmpeg specific) can be found at ​ HydrogenAudio Knowledgebase: Fraunhofer FDK AAC.

Note: libfdk_aac defaults to a low-pass filter of around 14kHz ( ​ details). If you want to preserve higher frequencies, use -cutoff 18000 . Adjust the number to the upper frequency limit only if you need to; keeping in mind that a higher limit may audibly reduce the overall quality.

Constant Bit Rate (CBR) mode

These settings target a specific bit rate, with less variation between samples. It gives you greater control over file size, and it is compatible with the HE-AAC profile. As a rule of thumb, for audible transparency, use 64 kBit/s for each channel (so 128 kBit/s for stereo, 384 kBit/s for 5.1 surround sound).

Set the bit rate with the -b:a option.

Examples

Convert an audio file to AAC in an M4A (MP4) container:

ffmpeg -i input.wav -c:a libfdk_aac -b:a 128k output.m4a

Convert 5.1 surround sound audio of a video, leaving the video alone:

ffmpeg -i input.mp4 -c:v copy -c:a libfdk_aac -b:a 384k output.mp4

Convert the video with libx264, with a target of fitting a 90-minute movie on a 700 MB (=5734400 KB) CD-ROM, mixing the audio down to two channels (Windows users should use NUL rather than /dev/null and ^ instead of \ ):

ffmpeg -y -i input.mp4 -c:v libx264 -b:v 933k -preset:v veryfast -pass 1 -an /dev/null && \ ffmpeg -i input.mp4 -c:v libx264 -b:v 933k -preset:v veryfast -pass 2 \ -ac 2 -c:a libfdk_aac -b:a 128k output.mp4

Variable Bit Rate (VBR) mode

Target a quality, rather than a specific bit rate. 1 is lowest quality and 5 is highest quality.

Set the VBR level with the -vbr flag.

VBR modes gives roughly the following bit rates per channel ( ​ details):

VBR kbps/channel AOTs
1 20-32 LC,HE,HEv2
2 32-40 LC,HE,HEv2
3 48-56 LC,HE,HEv2
4 64-72 LC
5 96-112 LC

HE bit rates will be much lower.

Note: A bug exists in libfdk-aac 0.1.3 and earlier that will cause a crash when using high sample rates, such as 96kHz, with VBR mode 5. ( ​ details).

Examples

Convert an audio file to AAC in an M4A (MP4) container:

ffmpeg -i input.wav -c:a libfdk_aac -vbr 3 output.m4a

From a video file, convert only the audio stream:

ffmpeg -i input.mp4 -c:v copy -c:a libfdk_aac -vbr 3 output.mp4

Convert the video with libx264, and mix down audio to two channels:

ffmpeg -i input.mp4 -c:v libx264 -crf 22 -preset:v veryfast \ -ac 2 -c:a libfdk_aac -vbr 3 output.mp4

High-Efficiency AAC

This is a pair of AAC profiles tailored for low bit rates (version 1 and version 2). HE-AAC version 1 is suited for bit rates below 64kb/s (for stereo audio) down to about 48 kb/s, while HE-AAC version 2 is suited for bit rates as low as 32 kb/s (again, for stereo).

Note: HE-AAC version 2 only handles stereo. If you have mono, or want to down-mix to mono, use HE-AAC version 1.

Unfortunately, many devices that can play AAC-LC (the default profile for libfdk_aac ) simply cannot play either version of HE-AAC, 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 HE-AAC, 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.

Examples

HE-AAC version 1:

ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a

HE-AAC version 2:

ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he_v2 -b:a 32k output.m4a

Native FFmpeg AAC Encoder ( aac )

The native FFmpeg AAC encoder. This is currently the second highest-quality AAC encoder available in FFmpeg and does not require an external library like the other AAC encoders described here. This is the default AAC encoder.

By default, the native encoder produces AAC-LC, which is a «low complexity» profile of baseline AAC. It actually supports the more powerful «main» and «long-term prediction» profiles (documentation), but these are less tested.

Examples

Constant bit rate using -b:a :

ffmpeg -i input.wav -c:a aac -b:a 160k output.m4a

Variable bit rate using -q:a :

ffmpeg -i input.wav -c:a aac -q:a 2 output.m4a

Effective range for -q:a is around 0.1-2. This VBR is experimental and likely to get even worse results than the CBR. Native FFmpeg AAC Encoder does not do CBR audio encoding.

audiotoolbox Encoder ( aac_at )

When a build is configured with —enable-audiotoolbox, Apple’s audioToolbox.framework (normally available only on macOS) will provide a series of codecs suffixed _at . Apple’s encoder ​ is even better than FDK-AAC according to HydrogenAudio. You may have come across this implementation on other platforms as «QAAC» or «audioToolboxWrapper», but licensing issues for these modifications is too much for FFmpeg to deal with.

Bitrate control is done by global flags. -global_quality:a can range from 0~14 for VBR and -b:a by default gives CBR. -aac_at_mode can be used to instead cause -b:a to provide AVR and CVBR. All profiles for libfdk_aac ‘s -profile:a option, including both versions of HE-AAC, are available.

Note: -profile option only accepts numeric values for aac_at encoder, e.g. 4 works as aac_he and 28 as aac_he_v2. ( ​ https://trac.ffmpeg.org/ticket/9574).

Metadata

You can add metadata to any of the examples on this guide:

ffmpeg -i input . \ -metadata author="FFmpeg Bayou Jug Band" \ -metadata title="Decode my Heart (Let's Mux)" \ output.mp4

Progressive Download

By default the MP4 muxer writes the ‘moov’ atom after the audio stream (‘mdat’ atom) at the end of the file. This results in the user requiring to download the file completely before playback can occur. Relocating this moov atom to the beginning of the file can facilitate playback before the file is completely downloaded by the client.

You can do this with the -movflags +faststart option:

ffmpeg -i input.wav -c:a libfdk_aac -movflags +faststart output.m4a

You can also use this option on existing MP4/M4A files. Since the audio is simply being stream copied there is no re-encoding occurring, just re-muxing, so therefore there is no quality loss:

ffmpeg -i input.m4a -c:a copy -movflags +faststart output.m4a

Which encoder provides the best quality?

For AAC-LC: aac_at ≥ libfdk_aac > Native FFmpeg AAC encoder ( aac ).

For HE-AAC it’s unclear whether aac_at or libfdk_aac is better.

Should I use AAC-LC or HE-AAC?

If you require a low audio bitrate, such as ≤ 32kbs/channel, then HE-AAC would be worth considering if your player or device can support HE-AAC decoding. Anything higher may benefit more from AAC-LC due to less processing. If in doubt use AAC-LC. All players supporting HE-AAC also support AAC-LC.

You might see that FDK AAC and audiotoolkit also support AAC-LD and AAC-ELD. These are low delay variants rarely used in music (hence unlikely to be supported), but useful for VoIP. In general, you will only turn it on when the receiving side explicitly requires one of these variants.

Also See

Last modified 6 месяцев ago Последнее изменение: 18 июл. 2023 г., 23:16:37

Вложения (5)

  • Original.png​ ( 1.1 MB ) — added by Rostislav Pehlivanov 9 лет ago. Original spectrum of a file prior to encoding
  • PNS_NO.png​ ( 753.8 KB ) — added by Rostislav Pehlivanov 9 лет ago. Spectral representation of file after being encoded without PNS
  • PNS1.2.png​ ( 820.5 KB ) — added by Rostislav Pehlivanov 9 лет ago. File encoded with new PNS implementation
  • PNS_2.2.png​ ( 757.5 KB ) — added by Rostislav Pehlivanov 9 лет ago. File encoded with old PNS implementation
  • Difference1.png​ ( 757.1 KB ) — added by Rostislav Pehlivanov 9 лет ago. Spectral difference of the file encoded with new vs old PNS implementation

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *