Log in

View Full Version : AAC audio encoding speed problem


rockydon
5th March 2017, 08:39
I m using megui since 6 months,I have been so far using AC3 audio encoding,my question is when I encode to AAC Format it takes longer time to encode audio (using megui for this)

I m encoding audio of length 2 hr 30 mins,when I encode to Ac3 format it takes only 3-4 mins,but when I encode through AAC it takes more than an hour,in AAC encoding I m using preferred encoder as LWLibavAudioSource

Irrespective of time taken in both formats file size turn out to be same for them,which is 170 mb

Is there any way I can encode AAC Format faster like AC3

I went through AAC FAQ,still bit concerned,just wanted to confirm,which is best encoder for HE-AAC and LC AAC, I wanted free full version encoding tool for this two,pls recommend me,thanks

tebasuna51
5th March 2017, 12:29
I m encoding audio of length 2 hr 30 mins,when I encode to Ac3 format it takes only 3-4 mins,but when I encode through AAC it takes more than an hour,in AAC encoding I m using preferred encoder as LWLibavAudioSource
Seems you have a problem encoding to AAC, 1 hour is not normal.

LWLibavAudioSource is the decoder, not the encoder, and we need know the encoder than you use.

Please put the MeGUI log.

Irrespective of time taken in both formats file size turn out to be same for them,which is 170 mb

This size for 2:30:00 implies than the average bitrate is 160 Kb/s.
This bitrate is a poor quality for a AC3 2.0, but very good quality for AAC 2.0.

Is there any way I can encode AAC Format faster like AC3

...which is best encoder for HE-AAC and LC AAC, I wanted free full version encoding tool for this two

I make a test using the same source, and LWLibavAudioSource like decoder, changing the encoders (encoding time extrapolated to a duration of 2:30:00):

Encoder Configured to Average Kb/s Encoding time
---------- ---------------- ------------ -------------
ffmpeg AC3 160 Kb/s CBR 160 70 sec.
NeroAacEnc VBR, Q= 0.5 auto 169 269 sec.
Qaac 160 Kb/s CVBR LC 165 269 sec.

Like you can see ffmpeg AC3 encoder is faster, but AAC encode can use less than 5 min.

Both AAC encoders offer the same quality at this bitrate.
If you want use poor quality (less than 48 Kb/s per channel) you may use Qaac HE, better than NeroAacEnc HE.

Both encoders must be downloaded out of MeGUI, freeware NeroAacEnc (http://www.videohelp.com/software/Nero-AAC-Codec) is easy but free qaac need some complex procedure (https://sites.google.com/site/qaacpage/home).

rockydon
5th March 2017, 13:46
Please put the MeGUI log.

i missed my log i have cleared it and u r right that i m encoding at 160 kbps,i need 5.1ch in that and as far i have figured i shuld be going for HE-AAC for 96 kbps to get 5.1 ch

I make a test using the same source, and LWLibavAudioSource like decoder, changing the encoders (encoding time extrapolated to a duration of 2:30:00)

yes thanks,bro just another simple confirmatory question,i need answers for both things

whether i encode LC AAC or HE AAC,which bitate is better CBRor VBR and if VBR than what shuld b q quality,or what q settings i must make to make it more good quality,what do u preferred me as CBR or VBR

i actually want 5.1 ch at lowest possible bitrate

also i have figured if i need LC AAC codec then i shuld have minimum of 192 kbps bitrate and to make HE AAC i should have maximum of 96 kbps

tebasuna51
5th March 2017, 15:27
5.1 Channels?

This is the qaac available encoder settings for 5.1:

LC 24000Hz 5.1 (C L R Ls Rs LFE) - 80,96,112,128,144,160,192,224,256,288,320
LC 32000Hz 5.1 (C L R Ls Rs LFE) - 128,144,160,192,224,256,288,320,384,448
LC 44100Hz 5.1 (C L R Ls Rs LFE) - 160,192,224,256,288,320,384,448,512,576,640,768
LC 48000Hz 5.1 (C L R Ls Rs LFE) - 160,192,224,256,288,320,384,448,512,576,640,768
HE 24000Hz 5.1 (C L R Ls Rs LFE) - 64,80,96,112,128,160
HE 32000Hz 5.1 (C L R Ls Rs LFE) - 64,80,96,112,128,160,192
HE 44100Hz 5.1 (C L R Ls Rs LFE) - 80,96,112,128,160,192
HE 48000Hz 5.1 (C L R Ls Rs LFE) - 80,96,112,128,160,192

Use CVBR

rockydon
5th March 2017, 16:02
5.1 Channels?

This is the qaac available encoder settings for 5.1:

LC 24000Hz 5.1 (C L R Ls Rs LFE) - 80,96,112,128,144,160,192,224,256,288,320
LC 32000Hz 5.1 (C L R Ls Rs LFE) - 128,144,160,192,224,256,288,320,384,448
LC 44100Hz 5.1 (C L R Ls Rs LFE) - 160,192,224,256,288,320,384,448,512,576,640,768
LC 48000Hz 5.1 (C L R Ls Rs LFE) - 160,192,224,256,288,320,384,448,512,576,640,768
HE 24000Hz 5.1 (C L R Ls Rs LFE) - 64,80,96,112,128,160
HE 32000Hz 5.1 (C L R Ls Rs LFE) - 64,80,96,112,128,160,192
HE 44100Hz 5.1 (C L R Ls Rs LFE) - 80,96,112,128,160,192
HE 48000Hz 5.1 (C L R Ls Rs LFE) - 80,96,112,128,160,192

Use CVBR
Thanks sir but I m new to this techie figures,don't knw how to get helped by them

tebasuna51
5th March 2017, 20:49
If your source is 48000 Hz 5.1 the minimum bitrate for HE is 80 Kb/s, for LC 160 Kb/s.

Of course with very low quality.

hello_hello
6th March 2017, 00:41
rockydon,
MeGUI can use three different AAC encoders. FDKAAC, NeroAAC and QAAC. Which one are you using?

Edit: Never mind. I assume it's FDKAAC.

I just ran some test encodes (MeGUI) using a 5.1ch DST source, 1 hour 56 min duration, CBR 192kb/s for each encode. I'd never normally encode that way, but I had to pick something. Nine year old Q9450 CPU. Times aren't necessarily 100% accurate due to my not always paying attention.

MeGUI's command lines for FDKAAC:
--ignorelength -m 0 -b 192 -p 2 - -o "D:\FDK.m4a"
--ignorelength -m 0 -b 192 -p 5 - -o "D:\FDK HE.m4a

FFmpeg AC3: 1 min 35 seconds
FDKAAC HE: 16 min 56 seconds
FDKAAC LC: 18 min 52 seconds
NeroAAC HE: 7 min 50 seconds
NeroAAC LC: 7 min 53 seconds
QAAC HE: 6 min 56 seconds
QAAC LC: 6 min 35 seconds

I tried encoding the same file again with foobar2000 and FDKAAC These two command lines:
--ignorelength -S -b 192000 --profile 5 -o %d -
--ignorelength -S -b 192000 -o %d -

FDKAAC HE: 9 min 36 seconds
FDKAAC LC: 7 min 11 seconds

I currently have no explanation regarding the difference in FDKAAC encoding speed, although the output files seem identical. Using MeGUI's command line with foobar2000 made no difference. I ran the FDKAAC encodes using MeGUI more than once to make sure I hadn't done something silly. I even copied the script MeGUI created for encoding and used it to encode with foobar2000, after copying the FDKAAC binary into the foobar2000 "encoders" folder to be absolutely certain I was encoding with the same version of the encoder. The encoding time for FDKAAC LC was still only 7 min 13 seconds.

LoadPlugin("C:\Program Files\MeGUI\tools\lsmash\LSMASHSource.dll")
LWLibavAudioSource("E:\test.dts")
# detected channels: 6
# detected channel positions: 3/2/0.1
return last

All I seem to be able to deduce so far is encoding starts off at normal speed when using MeGUI and gradually slows. Maybe encoding a two hour source wasn't sufficient for it to slow so much the total encoding time would have been an hour.

MeGUI:
-[Information] Log for job5 (audio, test.dts -> FDKAAC HE.m4a)
--[Information] [06/03/17 11:11:18 AM] Started handling job
--[Information] [06/03/17 11:11:18 AM] Preprocessing
--[Information] [06/03/17 11:11:18 AM] MediaInfo
---[Information] [06/03/17 11:11:18 AM] File: E:\test.dts
---[Information] General
----[Information] Format: DTS
----[Information] FormatString: DTS
----[Information] FileSize: 1317163848
----[Information] PlayTime: 01:56:22.976
---[Information] Audio
----[Information] ID:
----[Information] StreamOrder:
----[Information] Format: DTS
----[Information] FormatProfile:
----[Information] FormatSettingsSBR:
----[Information] FormatSettingsPS:
----[Information] SamplingRate: 48000
----[Information] SamplingRateString: 48.0 kHz
----[Information] Channels: 6
----[Information] ChannelsString: 6 channels
----[Information] ChannelPositionsString2: 3/2/0.1
----[Information] BitRateMode: CBR
----[Information] Delay:
----[Information] Title:
----[Information] Language:
----[Information] LanguageString:
----[Information] Default:
----[Information] DefaultString:
----[Information] Forced:
----[Information] ForcedString:
----[Information] [06/03/17 11:11:18 AM] The language information is not available for this track. The default MeGUI language has been selected.
--[Information] [06/03/17 11:11:18 AM] Trying to open the file with LWLibavAudioSource()
--[Information] [06/03/17 11:11:23 AM] Successfully opened the file with LWLibavAudioSource()
--[Information] [06/03/17 11:11:27 AM] Avisynth script
---[NoImage] LoadPlugin("C:\Program Files\MeGUI\tools\lsmash\LSMASHSource.dll")
---[NoImage] LWLibavAudioSource("E:\test.dts")
---[NoImage] # detected channels: 6
---[NoImage] # detected channel positions: 3/2/0.1
---[NoImage] return last
--[Information] [06/03/17 11:11:27 AM] Command line used: --ignorelength -m 0 -b 192 -p 5 - -o "{0}"
--[Information] [06/03/17 11:11:27 AM] Avisynth script environment opened
--[Information] [06/03/17 11:11:31 AM] Script loaded
--[Information] [06/03/17 11:11:31 AM] Output Decoder
---[Information] [06/03/17 11:11:31 AM] Channels: 6
---[Information] [06/03/17 11:11:31 AM] Bits per sample: 32
---[Information] [06/03/17 11:11:31 AM] Sample rate: 48000
--[Information] [06/03/17 11:11:31 AM] Job command line: C:\Program Files\MeGUI\tools\fdkaac\fdkaac.exe --ignorelength -m 0 -b 192 -p 5 - -o "D:\FDKAAC HE.m4a"
--[Information] [06/03/17 11:11:31 AM] Process started
--[Information] [06/03/17 11:11:31 AM] Standard output stream
--[Information] [06/03/17 11:11:31 AM] Standard error stream
--[Information] [06/03/17 11:28:26 AM] MediaInfo
---[Information] [06/03/17 11:28:26 AM] File: D:\FDKAAC HE.m4a

Foobar2000:
CLI encoder: fdkaac.exe
Destination file: D:\foobar FDK LC.m4a
Encoder stream format: 48000Hz / 6ch / 24bps
Command line: "C:\Program Files\foobar2000\encoders\fdkaac.exe" --ignorelength -S -b 192000 -o "foobar2000 FDK.m4a" -
Working folder: D:\
Encoder process still running, waiting...
Encoder process terminated cleanly.
Track converted successfully.
Total encoding time: 7:11.609, 16.17x realtime

hello_hello
6th March 2017, 06:09
I strongly suspect it's something to do with the encoder not handling 32 bit input well, but I haven't been able to confirm that. So far though, if I add ConvertAudioTo32bit() to the script and open it with foobar2000, FDKAAC encoding speed drops dramatically, but QAAC still encodes at the normal speed.

I'm not sure if the same applies to 32 bit float though because the foobar2000 AVS input plugin doesn't seem to accept it, and the MeGUI log file doesn't specify if the audio output is integer or float anyway, and I've run out of time at the moment.

tebasuna51
6th March 2017, 13:30
I'm not sure if the same applies to 32 bit float though because the foobar2000 AVS input plugin doesn't seem to accept it, and the MeGUI log file doesn't specify if the audio output is integer or float anyway, and I've run out of time at the moment.

The output of many AviSynth audio decoders (LSMASHSource.dll, NicAudio.dll, ...) is always 32 bit float.

But AviSynth, by default, convert the output to 16 bit int samples, unless...

1) You add to .avs:
global OPT_AllowFloatAudio=True

2) Or use a special AvisynthWrapper.dll
Like MeGUI and BeHappy do.

Then MeGUI/Behappy output is always 32 bit float with a simple.avs like:
LWLibavAudioSource("E:\test.dts")

You can use wavi over the simple.avs:

wavi simple.avs 16bit.wav

With a float.avs like:
global OPT_AllowFloatAudio=True
LWLibavAudioSource("E:\test.dts")

wavi float.avs 32float.wav

You can use wavi to check encoders:

wavi input.avs - | aacencoder ...

With Foobar2000 there are a new (today) http://www.foobar2000.org/components/view/foo_input_avs
than works for me with 32 float output.

hello_hello
6th March 2017, 16:57
Thanks for the info tebasuna51

With Foobar2000 there are a new (today) http://www.foobar2000.org/components/view/foo_input_avs
than works for me with 32 float output.

That was due to my my bug report while trying to diagnose the FDKAAC speed problem and some exceptionally speedy bug fixing by kode54.
https://hydrogenaud.io/index.php/topic,42705.msg936439.html#msg936439

I haven't had a chance to do any more FDKAAC testing though.

rockydon
6th March 2017, 21:34
Thanks for comments