PDA

View Full Version : HowTo correctly avoid resampling problems with Nero AAC encoder in Besweet/Oagmachine


bond
2nd January 2004, 17:29
IMPORTANT UPDATE:
thanks to great DSPGuru all the info posted in this thread is now used by besweet (since bsn.dll version 0.21) to automatically set the SSRC resampling values (no need to change that by hand anymore)
now lets hope that the ahead devs dont change any of these values :D


as i very often read some posts which claimed that you have to always resample to 44.1khz when using the nero aac encoder dlls with besweet/oagmachine, i wanted to make clear that this is not correct! you will get borked output in many cases if you do so!

this thread aims to tell you how to correctly use the ssrc resampling option in besweet/oagmachine to avoid resampling problems:

a) how the nero dlls work (according to menno)
1) the nero encoder dlls themselves dont do any resampling
2) the resampling is done by an own nero resampling plugin
3) the user chooses a bitrate and the encoder requests a specific sampling rate as input for this bitrate
4) now the resampling plugin would normally resample to this specific sampling rate
5) but nencoder and besweet ignore this request, therefore the encoder dlls dont get the requested input sampling rate

example:
a user chooses 80kbps lc-aac as output in the nero encoder. the encoder requests 32khz for that bitrate, but besweet gives him 48khz or 44.1khz (or whatever other, from 32khz different, setting the user choose to resample to in besweet)
->
the output is borked


b) conclusion
you have to feed the nero encoder with the sampling rate he needs for a specific bitrate, otherwise you will get a wrong output
which means in besweet you have to set the correct sampling rate by using ssrc!

i now tested all possible sampling rates at specific bitrates with the following results:

bitrate samplerate profile samplerate

CBR VBR

HE-AAC HE-AAC
mono stereo 5.1 stereo 5.1
8 24000 16 24000 40 24000 Tape 44100 Tape 44100
10 24000 20 24000 48 24000 Radio 44100 Radio 44100
12 32000 24 32000 64 32000 Internet 44100 Internet 44100
14 32000 28 32000 80 32000 Streaming 44100 Streaming 44100
16 44100 32 44100 96 44100
20 44100 40 44100 112 44100
24 44100 48 44100 128 44100
28 44100 56 44100 144 44100
32 44100 64 44100 160 44100
40 44100 80 44100 192 44100
48 44100 96 44100

LC-AAC LC-AAC
mono stereo 5.1 stereo 5.1
8 8000 16 8000 40 8000 Tape 24000 Tape 24000
12 11025 20 8000 48 11025 Radio 32000 Radio 32000
16 16000 24 11025 64 16000 Internet 44100 Internet 44100
20 16000 28 11025 80 16000 Streaming 44100 Streaming 44100
24 22050 32 16000 96 22050 Normal 44100 Normal 44100
28 24000 40 22050 128 24000 Extreme 44100 Extreme 44100
32 32000 48 22050 160 32000 Audiophile 44100 Audiophile 44100
40 32000 56 24000 192 32000 Transcoding 44100 Transcoding 44100
56 44100 64 32000 225 32000
64 44100 80 32000 256 44100
80 44100 96 32000 288 44100
96 44100 112 44100 320 44100
112 44100 128 44100 384 44100
128 44100 144 44100 480 44100
160 44100 160 44100 512 44100
192 44100
256 44100

examples:
you want to encode multichannel, vbr, with he-aac and the streaming preset:
you have to set the sampling rate in besweet under ssrc to 44100

you want to encode stereo, cbr, with lc-aac at 96kbps:
you have to set the sampling rate in besweet under ssrc to 32000

KpeX
2nd January 2004, 17:58
Nice work bond! Thanks for performing these tests. AAC FAQ #19 updated with this info.

bobsc
2nd January 2004, 18:01
I'm sure the same is true using BeSweetGUI.

bond
2nd January 2004, 18:12
Originally posted by bobsc
I'm sure the same is true using BeSweetGUIof course
this is true for every tool that is based on the nencoder tool, ie besweet (with gui), oagmachine or all tools that use the nencoder commandline tool directly

its nencoders fault that it ignores the request from the encoder plugin for a specific samplerate

foobars foo_nero plugin doesnt use nencoder and handles this request fine already, read more about it here (http://forum.doom9.org/showthread.php?s=&threadid=67746)!

bobsc
2nd January 2004, 18:19
Originally posted by bond
foobars foo_nero plugin doesnt use nencoder and handles this request fine already, read more about it here (http://forum.doom9.org/showthread.php?s=&threadid=67746)!
foo_nero is based on NEncode.

bond
2nd January 2004, 18:21
according to menno it isnt (perhaps it was in the beginning)

but plz discuss foobar issues in the foobar thread ;)

bobsc
2nd January 2004, 18:28
In foobar click components then click foo_nero. It says based on NEncode.

Tuning
2nd January 2004, 18:40
Thanks bond, this is what i was expecting for ages. I have already done similar tests a while ago, but could not conclude anything.(Though the test was not detailed as you did). And mikeson and I did pointed DSPguru to give a clarification on this phenomenon. But as Dg has no time he could not reply. And for the time I put resampling to 44 in faq like doom9 did in Oagmachine guide. Thanks for clarfying.

Thanks for the detailed table too. Now if an algorithm is made on these table, I think BeSweet also can properly encode at every sampled sound.
For the time being we could manually use this table.


btw I have a doubt, only LC CBR profile (stereo and 5.1) doesn't allow 48khz encoding, mono and VBR can do it perfectly.


btw2, bond if you can again contact menno, can you ask the bitrate distribution question for LC AAC. (2x128+64+1=321kbps) vs (2x96+48+1=241kbps). I still doubt it.

Thanks

bond
2nd January 2004, 18:58
Originally posted by Tuning
btw I have a doubt, only LC CBR profile (stereo and 5.1) doesn't allow 48khz encoding, mono and VBR can do it perfectly.hm how do you get these results?
i now deleted the 48khz marks as i checked it again and it seems, although the encoder can handle 48khz in some cases when accessed through buring rom, that when used with besweet it doesnt handle 48khz input at all

btw2, bond if you can again contact menno, can you ask the bitrate distribution question for LC AAC. (2x128+64+1=321kbps) vs (2x96+48+1=241kbps). I still doubt it.hm simply send him a pm, he also around on doom9

mikeson
4th January 2004, 14:10
Ivan Dimkovic already explained it here (http://www.hydrogenaudio.org/index.php?showtopic=15883&).

Tuning
6th January 2004, 11:00
Originally posted by mikeson
Ivan Dimkovic already explained it here (http://www.hydrogenaudio.org/index.php?showtopic=15883&).

mikeson, thanks for putting up the link again. The FAQ question was actually an abstract of this thread. But on thorough reading, I find that he author of thread is asking for AAC bitrates for equvalent "CD-quality". So now from some AAC documentation, I learned that AAC(LC) @ 96kbps is equvalent to "CD-quality". That is causing the doubt above quoted.
So I think instead of using 128, the bitrate should be 96kbps. That is all. I have already PMed menno with this doubt. Hope he will visit doom9 soon and we could get an explanation.

DSPguru
6th January 2004, 22:57
thank you bond for your research and posting this informative thread, but the bug had been fixed now (due to tip from menno), and the best way to avoid resampling problems now is just to work with the latest BeSweet binaries.

bobsc
6th January 2004, 22:59
Thank you DSPguru.

bond
6th January 2004, 23:27
great thanks a lot dspguru!

Tuning
7th January 2004, 05:34
Originally posted by DSPguru
...but the bug had been fixed now (due to tip from menno), and the best way to avoid resampling problems now is just to work with the latest BeSweet binaries.

Thanks DSPGuru, from doom9.org build its working. Yesterdays BeSweet1.5b25, was not working.:)

Thanks.