Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th December 2003, 16:19   #1  |  Link
tiki4
Registered User
 
tiki4's Avatar
 
Join Date: Dec 2001
Location: Who Knows?
Posts: 929
AC3 to AAC/MP4 with foobar2000

Topic:

My friend tuning asked me about different ways to transcode AC3 to the AAC format. There are quite some options now that all make use of the Nero AAC encoder. Nero AAC is the only publically available codec that provides the 'High Efficiency' (HE-AAC) profile for low bitrate encoding which comes in very handy for DivX/XviD movies. Currently Nencode, Oagmachine (featuring BeSweet/bsn.dll) and foobar2000 make use of the Nero engine. However, foobar2000 is a little bit different it seems, as it doesn't use the Nero libraries directly, but the Nero API IMHO.

Aim:

Well, aim of this thread should be to compile a guide how to trancode AC3 to AAC/MP4 in foobar2000. fb2k isn't the easiest program to use IMHO and people who did it could share their experience here.

Differences to Oagmachine:

THE FOLLOWING STATEMENT IS NO LONGER VALID, RESAMPLING ISSUE IS SOLVED WITH BeSweet 1.5b25, THANKS DSPGuru

Well, Nencode and BeSweet share a common problem which has to do with resampling. Choosing a certain bitrate or VBR profile the Nero encoder expects certain sampling rates to be provided. Now all DVD audio is 48 kHz and the current solution is to resample in BeSweet/Oagmachine to 44.1 kHz, otherwise the output file gets broken in certain scenarios. fb2k on the other hand seems to manage this 'more correctly'. In what sense is to be found out.

Preliminary how-to (for 5.1 output):

In the first place you need foobar2000 from Case's site. It is labeled 'special installer'. During installation make sure that AC3 is selected in the optional components/Input section and also the disk writer component. Also you need the Nero encoder/decoder from the same site. Copy the included foo_nero.dll to your foobar2000/components folder. Finally you need a full version of Nero 6 installed.

Now here begins the fun: Add an AC3 file to the fb2k playlist. Now in the preferences look for components/diskwriter. Select 'Nero encoder' as output format. Check that DSP and replaygain isn't used. Now check for 'Nero encoder' component and select "MPEG4 Advanced Audio Coding" as output format. Configure the Nero plugin to your likings. Don't forget to enable 'dynamic range reduction' in the AC3 component settings. Now close preferences again and right click your AC3 in the fb2k playlist window. Choose convert. That's it in principle. You may change the output naming and the output directory.

Feeback:

Now, please provide your feedback and corrections! Tell us your findings and remember that the AC3 decoding part in foobar isn't azid, but liba52 like Valex's AC3filter uses it. Thus different results are absolutely possible.

Thanks to tuning for the idea.

Last edited by tiki4; 8th January 2004 at 09:44.
tiki4 is offline   Reply With Quote
Old 30th December 2003, 18:44   #2  |  Link
bobsc
Registered User
 
bobsc's Avatar
 
Join Date: May 2003
Location: Midwest
Posts: 149
Your preliminary how-to is for 5.1 output.
If you want 2 channel output you would enable DSP and go to DSP Manager and move "Convert 5.1 to stereo" to Active DSPs.
__________________
bobsc
bobsc is offline   Reply With Quote
Old 30th December 2003, 18:53   #3  |  Link
mikeson
Registered User
 
Join Date: Dec 2001
Location: Czech Republic
Posts: 261
I use this method some time and found only one problem till now:
- when source is 2ch AC3, result is always 5.1 AAC/MP4, there seems to be bug in foo_ac3.dll
__________________
mikeson
mikeson is offline   Reply With Quote
Old 30th December 2003, 19:15   #4  |  Link
bobsc
Registered User
 
bobsc's Avatar
 
Join Date: May 2003
Location: Midwest
Posts: 149
@mikeson
I never tried a 2ch AC3, but try "Convert 5.1 to stereo".
__________________
bobsc
bobsc is offline   Reply With Quote
Old 30th December 2003, 19:42   #5  |  Link
Tuning
I'm back! :D
 
Tuning's Avatar
 
Join Date: Aug 2003
Location: The Matrix
Posts: 1,029
Thanks tiki4.

@bobsc,
Do the option: convert stereo to 4 channel (in DSP manager)affect AAC encoding?
Thanks
__________________
My Blog
Tuning is offline   Reply With Quote
Old 30th December 2003, 19:50   #6  |  Link
bobsc
Registered User
 
bobsc's Avatar
 
Join Date: May 2003
Location: Midwest
Posts: 149
Quote:
Originally posted by Tuning
@bobsc,
Do the option: convert stereo to 4 channel (in DSP manager)affect AAC encoding?
Thanks
Never tried it.
__________________
bobsc
bobsc is offline   Reply With Quote
Old 31st December 2003, 12:22   #7  |  Link
tiki4
Registered User
 
tiki4's Avatar
 
Join Date: Dec 2001
Location: Who Knows?
Posts: 929
Quote:
Originally posted by bobsc
Your preliminary how-to is for 5.1 output.
If you want 2 channel output you would enable DSP and go to DSP Manager and move "Convert 5.1 to stereo" to Active DSPs.
That's right, I edited that right away. Any more comments in comparison to Oagmachine? I guess foobar2000 is a versatile tool and since it can also play FLAC/Cue/MKA I use it again a little more often.

Thanks for your answers so far, but I still hope more people try that.

Is there a way to normalize the file without replaygaining? No direct show filter can make use of the replaygain tags so far and possibly foobar2000 uses Ape2 tags for that, please correct me.

tiki4
tiki4 is offline   Reply With Quote
Old 31st December 2003, 14:24   #8  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
nice guide!

i would also mention that next to nero, people can also use the faac codec, which is getting constantly better (but shouldnt be used for multichannel as it doesnt provide he-aac)

Quote:
Originally posted by tiki4
Is there a way to normalize the file without replaygaining? No direct show filter can make use of the replaygain tags so far and possibly foobar2000 uses Ape2 tags for that, please correct me.
the official way would be to adjust the "volume element" in MP4 (other ways by using tags or so, will probably never be supported by standalones etc.), but no tool can do that till now (was discussed here)...
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 31st December 2003, 15:27   #9  |  Link
Tuning
I'm back! :D
 
Tuning's Avatar
 
Join Date: Aug 2003
Location: The Matrix
Posts: 1,029
Quote:
Originally posted by bond
the official way would be to adjust the "volume element" in MP4 (other ways by using tags or so, will probably never be supported by standalones etc.), but no tool can do that till now (was discussed here)...
@bond

how this volume element works. i.e do mp4 container gives infos to decoder to increase volume or similar. Can a brief explanation be done?

Thanks
__________________
My Blog
Tuning is offline   Reply With Quote
Old 31st December 2003, 15:52   #10  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
Quote:
Originally posted by Tuning
how this volume element works. i.e do mp4 container gives infos to decoder to increase volume or similar. Can a brief explanation be done?
you will find everything that is know about the volume element in the thread i pointed to
afaik the splitter needs to pass that info to the decoder (from what shitowax said the 3ivx splitter already would handle it)

it seems that apple uses an own tag to store postgain info in mp4, but i dont know exactly how it works...
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 31st December 2003, 16:07   #11  |  Link
Tuning
I'm back! :D
 
Tuning's Avatar
 
Join Date: Aug 2003
Location: The Matrix
Posts: 1,029
Quote:
afaik the splitter needs to pass that info to the decoder (from what shitowax said the 3ivx splitter already would handle it)
Thanks for the info!
__________________
My Blog
Tuning is offline   Reply With Quote
Old 1st January 2004, 15:44   #12  |  Link
tiki4
Registered User
 
tiki4's Avatar
 
Join Date: Dec 2001
Location: Who Knows?
Posts: 929
Actually I found out, how to maximize the sound when transcoding AC3 to AAC. It's quite easy, as you just have to replaygain the original AC3 and enable 'use replaygain' in the Diskwriter options. This won't work for 5.1 -> 2.0 so far, but I'll work on that, too. I start to like that little app, although the GUI could really need some improvement.

tiki4
tiki4 is offline   Reply With Quote
Old 2nd January 2004, 14:22   #13  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
Quote:
Originally posted by tiki4
Differences to Oagmachine:
Well, Nencode and BeSweet share a common problem which has to do with resampling. Choosing a certain bitrate or VBR profile the Nero encoder expects certain sampling rates to be provided. Now all DVD audio is 48 kHz and the current solution is to resample in BeSweet/Oagmachine to 44.1 kHz, otherwise the output file gets broken in certain scenarios. fb2k on the other hand seems to manage this 'more correctly'. In what sense is to be found out.
its not the fault of the nero encoder but of the nencoder tool, which besweet is based on:

Quote:
Originally written by menno
besweet and nencoder don't respect the input request of the encoder
basically you provide some info to the encoder config, then the encoder config tells what kind of input it needs
besweet and nencoder completely ignore that and just provide data as is

foobar2000 does this correctly. it doesnt use nencoder, it has it's own foo_nero component that handles the input request of the nero encoder correctly
maybe it would be a good idea to base bsn.dll on the source of this foo_nero plugin than on nencoder...
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free

Last edited by bond; 2nd January 2004 at 14:24.
bond is offline   Reply With Quote
Old 2nd January 2004, 14:41   #14  |  Link
bobsc
Registered User
 
bobsc's Avatar
 
Join Date: May 2003
Location: Midwest
Posts: 149
Quote:
Originally posted by bond
maybe it would be a good idea to base bsn.dll on the source of this foo_nero plugin than on nencoder...
I think that would be a good idea also.
__________________
bobsc
bobsc is offline   Reply With Quote
Old 2nd January 2004, 14:54   #15  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
Quote:
Originally written by menno
basically you provide some info to the encoder config, then the encoder config tells what kind of input it needs
to make clear what this means menno told me the following:

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
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 as output in the nero encoder. the encoder requests 32khz for that bitrate, but besweet gives him 48khz or 44.1khz (or whatever else the user choose to resample to in besweet)
->
the output is borked

you have to feed the nero encoder with the sampling rate he needs for a specific bitrate, otherwise you will get a wrong output

in besweet you have to do this manually by using ssrc, foobar can do this automatically...
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 3rd January 2004, 10:19   #16  |  Link
Tuning
I'm back! :D
 
Tuning's Avatar
 
Join Date: Aug 2003
Location: The Matrix
Posts: 1,029
Finally I could play with foobar2000 (..not forgetting I was winampfan till yesterday...). I have some newbie doubts, need to be clarified by someone.

What is replaygain?
How to use it?

I found it can also be used while transcoding. But i did my best to find out what is it.... no luck. The final mp4 file didn't had any replaygain info eventhough i used it while encoding.

In short:
I did scan replay gain for full album. Then selected nero encoder and HE-AAC in diskwriter options. Also ticked "use replay gain' in processing. Nothing special was found in final mp4 file.

Another Q: Is it possible to transcode wma to blah format using foobar2k?
I always get foo_wma.dll failed to load error. I think this plugin is missing in installation. Where can I get it.

Thanks.
__________________
My Blog
Tuning is offline   Reply With Quote
Old 3rd January 2004, 10:40   #17  |  Link
bobsc
Registered User
 
bobsc's Avatar
 
Join Date: May 2003
Location: Midwest
Posts: 149
http://replaygain.hydrogenaudio.org/
http://www.saunalahti.fi/cse/foobar2000/
__________________
bobsc
bobsc is offline   Reply With Quote
Old 3rd January 2004, 15:25   #18  |  Link
tiki4
Registered User
 
tiki4's Avatar
 
Join Date: Dec 2001
Location: Who Knows?
Posts: 929
Quote:
Originally posted by bond
to make clear what this means menno told me the following:

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
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 as output in the nero encoder. the encoder requests 32khz for that bitrate, but besweet gives him 48khz or 44.1khz (or whatever else the user choose to resample to in besweet)
->
the output is borked

you have to feed the nero encoder with the sampling rate he needs for a specific bitrate, otherwise you will get a wrong output

in besweet you have to do this manually by using ssrc, foobar can do this automatically...
Sorry, bond, but I think it isn't that easy.

An example:

1. I use BeSweet with latest Nero dlls. I choose '-6chnew', and 'streaming' + HE-AAC. Output is borked, as expected.

2. I decode to 6ch AIFF in BeSweet without resampling and use this as input in the Nero 'encode files'. Nero resamples that internally to 44.1 kHz (b.t.w, I chose 'sine' 100 for playback and other purposes in the resampler setup as recommended by Ivan). Same settings 'streaming' and High efficiency. The output file is 44.1 kHz but has nasty clicks.

3. I use foobar2000 with foo_nero.dll. Same settings as above, no resampling. The output file is definitely 48 kHz and plays flawless. Strange, isn't it? I rather expected to get the same results as with direct encoding in Nero.

tiki4
tiki4 is offline   Reply With Quote
Old 3rd January 2004, 16:33   #19  |  Link
tiki4
Registered User
 
tiki4's Avatar
 
Join Date: Dec 2001
Location: Who Knows?
Posts: 929
Quote:
Originally posted by Tuning
Finally I could play with foobar2000 (..not forgetting I was winampfan till yesterday...). I have some newbie doubts, need to be clarified by someone.

What is replaygain?
How to use it?

I found it can also be used while transcoding. But i did my best to find out what is it.... no luck. The final mp4 file didn't had any replaygain info eventhough i used it while encoding.

In short:
I did scan replay gain for full album. Then selected nero encoder and HE-AAC in diskwriter options. Also ticked "use replay gain' in processing. Nothing special was found in final mp4 file.

Another Q: Is it possible to transcode wma to blah format using foobar2k?
I always get foo_wma.dll failed to load error. I think this plugin is missing in installation. Where can I get it.

Thanks.
1. You may use replaygain to find the max volume without clipping. The thing is you can't do something like two-pass normalize in foobar2000. However, replaygaining the input AC3 files and using that info during transcoding to AAC should yield the same effect.

2. foo_wma.dll just loads correctly if you have the WM9 Codecs installed (either WMP 9, WME 9 or just the codec pack, it's on microsoft.com [bäh]).

tiki4

P.S. I tried now two times to send you PM, but it seems your mailbox is full
tiki4 is offline   Reply With Quote
Old 3rd January 2004, 16:40   #20  |  Link
mikeson
Registered User
 
Join Date: Dec 2001
Location: Czech Republic
Posts: 261
@tiki4:
Quote:
Actually I found out, how to maximize the sound when transcoding AC3 to AAC
Thanks a lot for this tip, tiki4. I've just transcoded 2 5.1 AC3 files to AAC (replaygained AC3 first), then tried to replaygain transcoded AAC files again and replaygain_track_gain was about 0.1 dB, so replaygain was really used while transcoding.
__________________
mikeson
mikeson is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.