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 10th June 2008, 04:08   #1  |  Link
FulciLives
Registered User
 
Join Date: Apr 2002
Posts: 106
Help! How to convert 5.1 AAC to 5.1 AC-3

Well the subject says it all.

I have a 5.1 AAC audio file.



Now I would like to convert this to a standard DVD Video compliant 5.1 AC-3 audio file.

I have no idea how to do this.

Normally I use Soft Encode when doing AC-3 encoding so if there is a way to get 6 mono WAV files out of the 5.1 AAC then that would be great although I'm open to whatever solutions are offered.

Thank you

- John "FulciLives" Coleman

Last edited by FulciLives; 10th June 2008 at 04:10. Reason: Edited for poor grammar
FulciLives is offline   Reply With Quote
Old 10th June 2008, 04:38   #2  |  Link
unskinnyboy
Registered User
 
unskinnyboy's Avatar
 
Join Date: Feb 2004
Location: NTSC R1
Posts: 2,046
http://forum.doom9.org/showthread.ph...230#post666230

Apart from the above, VLC Media Player can also do it (Stream/Transcoding Wizard, accessed by File -> Wizard), but VLC isn't a good tool for this purpose (like they themselves admit).
__________________
unskinnyboy is offline   Reply With Quote
Old 10th June 2008, 08:48   #3  |  Link
FulciLives
Registered User
 
Join Date: Apr 2002
Posts: 106
I thank you for the suggestion and the link but unfortunately I didn't get very far.

I've never used GraphEdit before so I downloaded it (the version I found is GraphEdit build 011008) and I ran the register.bat which seemed to work and then I start GraphEdit but as soon I try to load the AAC file I get the following error:



I have no idea what that means or what needs to be done to fix it.

Maybe I should point out that I'm using Linux Mint 4.0 and that my WinXP Pro SP3 install is under VirtualBox.

UPDATE ... just now I tried to open a standard XviD MPEG-4 file (with muxed AC-3 audio) and it worked.

However it sure did not like that AAC file.

Any ideas on what I need to do? Maybe it's a FFDSHOW issue?

- John "FulciLives" Coleman

*** EDIT ***
Nevermind ... I figured it out ... well I guess I did LOL

The AAC was in a MKV and I had demuxed it. I tried loading the MKV into GraphEdit and then it worked. So problem solved.

Although this seems like an "odd" way to do an audio conversion. I can't believe there isn't a "better" way?

I still would prefer to get 6 mono wav files out of the AAC so I can use Soft Encode for the AC-3 encoding.

Last edited by FulciLives; 10th June 2008 at 09:23. Reason: Because I am stupid
FulciLives is offline   Reply With Quote
Old 13th June 2008, 18:03   #4  |  Link
zeevaa
Registered User
 
Join Date: Mar 2008
Posts: 3
After a lot of searching net and reading forums I finally able to convert aac file to ac3 file with 5.1 output

I used faad2 to decode the AAC to a 6ch WAV.

faad2 -o input.wav output.ac3

This program can make a 6ch wav file greater than 4 GB if the aac input is greater than 135 m. (44 Kh) or 124 m. (48 Kh).
Now there is an overflow in two header's fields (4 bytes).
This makes a header WAVE_FORMAT_EXTENSIBLE with AudioFormat 0xFFFE ?, this must be changed to AudioFormat PCM 0x0001.
Open the wav file in hex editor, go to offset 0x14 (0x = hexadecimal). If there are 01 the file is ok, but if there are FE you must change to 01.
In offset 0x15 the value FF must be corrected to 00.
(Actullay I have done this after splitting the 6ch wav file into 6 mono wav files using xvi32.)

Then I used BeSplit command line to split that WAV into 6 mono WAVs using this:

besplit -core( -input output.wav -prefix mono -demux -type wav )

I found that the order of the 6 mono wav files is : FL,FR,C,LFE,SL,SR.

BeSplit has a bug in the header of the mono wavs, the field BlockAlign is fixed to 6 but it must be 2 (mono 16 bits)
For the field BlockAlign in the 6 mono wav you must open the 6 mono01.wav ... mono06.wav, and go to offset 0x20 (0x = hexadecimal) and change the value 06 to 02.
Then I used aften to convert 6 mono channel wav files into one ac3 file

aften.exe -b 224 -acmod 7 -lfe 1 -ch_fl "mono01.wav" -ch_fr "mono02.wav" -ch_fc "mono03.wav" -ch_lfe "mono04.wav" -ch_sl "mono05.wav" -ch_sr "mono06.wav" "output.ac3"

I wrote a batch file for doing all this automattically.

SET AACFILE=somefile.aac
faad2 -o output.wav %AACFILE%
besplit -core( -input output.wav -prefix mono -demux -type wav )
FOR %%f IN (mono*.wav) DO START /W xvi32.exe %%f /S=mono.xsc
aften.exe -b 224 -acmod 7 -lfe 1 -ch_fl "mono01.wav" -ch_fr "mono02.wav" -ch_fc "mono03.wav" -ch_lfe "mono04.wav" -ch_sl "mono05.wav" -ch_sr "mono06.wav" "output.ac3"
pause

Just place the aac file in seperate folder with all the required softwares and set the aacfile name in the batch file and run the batch file you will get output.ac3 file with 5.1 channel. I wrote a script file called mono.xsc for changing the bits in 6 mono wave file.

ADR $14
OVERWRITE 01
ADR $15
OVERWRITE 00
ADR $20
OVERWRITE 02

The files needed can be downloaded from the following link

http://rapidshare.com/files/122193806/aac2ac3.zip.html
zeevaa is offline   Reply With Quote
Old 14th June 2008, 02:27   #5  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by zeevaa View Post
...
This program can make a 6ch wav file greater than 4 GB if the aac input is greater than 135 m. (44 Kh) or 124 m. (48 Kh).
Now there is an overflow in two header's fields (4 bytes).
This makes a header WAVE_FORMAT_EXTENSIBLE with AudioFormat 0xFFFE ?, this must be changed to AudioFormat PCM 0x0001.
Open the wav file in hex editor, go to offset 0x14 (0x = hexadecimal). If there are 01 the file is ok, but if there are FE you must change to 01.
In offset 0x15 the value FF must be corrected to 00.
(Actullay I have done this after splitting the 6ch wav file into 6 mono wav files using xvi32.)

Then I used BeSplit command line to split that WAV into 6 mono WAVs using this:

besplit -core( -input output.wav -prefix mono -demux -type wav )

I found that the order of the 6 mono wav files is : FL,FR,C,LFE,SL,SR.

BeSplit has a bug in the header of the mono wavs, the field BlockAlign is fixed to 6 but it must be 2 (mono 16 bits)
For the field BlockAlign in the 6 mono wav you must open the 6 mono01.wav ... mono06.wav, and go to offset 0x20 (0x = hexadecimal) and change the value 06 to 02.
Then I used aften to convert 6 mono channel wav files into one ac3 file
You are absolutely right with this workaround.
You remember me my first post in this forum.

Your reward is the knowledge. Don't hate me if I say you a more simple method:

faad2 input.aac -o intermediate.wav
aften -readtoeof 1 -b 384 intermediate.wav output.ac3

Aften can:
- read WAVE_FORMAT_EXTENSIBLE header, don't need change the AudioFormat.
- read wav files > 4GB with the -readtoeof 1 parameter

And using Foobar2000 or BeHappy with Aften, you can do the same job without the intermediate.wav file. The process is fast because you don't need write the big wav file in disk.

Greetings.

Last edited by tebasuna51; 14th June 2008 at 02:33.
tebasuna51 is offline   Reply With Quote
Old 14th June 2008, 16:43   #6  |  Link
zeevaa
Registered User
 
Join Date: Mar 2008
Posts: 3
Thank you for valuable reply. While converting either aac file or wave file directly to ac3 file,I found that the order of channels is not correct while playing. Hence I split the wave file and reorder it. Even though my method is a long process (so that I automate using batch file) I got perfect result.
zeevaa is offline   Reply With Quote
Old 14th June 2008, 17:06   #7  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Like you know the wav output from faad is with WAVE_FORMAT_EXTENSIBLE header and the channel order must be, and is, FL-FR-FC-LF-BL-BR and can't be other.

From the beginning the Aften input default order is, like other modern encoders, the standard for uncompressed wav format FL-FR-FC-LF-BL-BR, and can't be other if the wav have WAVE_FORMAT_EXTENSIBLE header.


Then the correct way to transcode aac->ac3 is let the faad default order and the Aften default order, if you remap the channels you have wrong result.

With:
-ch_fl "mono01.wav"
-ch_fr "mono02.wav"
-ch_fc "mono03.wav"
-ch_lfe "mono04.wav"
-ch_sl "mono05.wav"
-ch_sr "mono06.wav"

you don't remap the channels, then is the same than use the wav multichannel like Aften input.
tebasuna51 is offline   Reply With Quote
Old 16th June 2008, 14:03   #8  |  Link
zeevaa
Registered User
 
Join Date: Mar 2008
Posts: 3
Dear tebasuna51, the aften command direct wave to ac3 working
correctly, thank you
zeevaa 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 14:33.


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