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 > Linux, Mac OS X, & Co
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th April 2004, 22:49   #1  |  Link
KpeX
Registered User
 
KpeX's Avatar
 
Join Date: Jun 2003
Location: Great Lakes, USA
Posts: 1,433
5.1 AC3 > 5.1 AAC under linux?

Hi -

Has anyone succeeded in converting 5.1 AC3 to 5.1 AAC under linux (using FAAC)? FFMPEG doesn't appear to support 5.1 AAC encoding, only stereo, and I haven't found anything that supports piping a 5.1 pcm stream to FAAC.
__________________
KpeX
Audio FAQs: General | BeSweet | SVCD/MP2 | MP3 | Vorbis | AC3 | DTS | AAC
Linux Audio/Video FAQ
KpeX is offline   Reply With Quote
Old 28th April 2004, 08:11   #2  |  Link
-NoXy-
Registered User
 
Join Date: Apr 2004
Location: Dubai, UAE
Posts: 3
hi, this is my first post here on the forums and i'm a noob :-)
I have to say that it was hard not to be able to post for 5 days but worth it - i learned a lot.
but still i might have the answer to ur question though i ve never heard of AAC be4 and i dont know the exact definition for a 5.1 output (supposed 6 channels~ correct me if im wrong).
after some minutes of reading man pages and an 'emerge faac' i came up with this:

mkfifo audiodump.wav
faac audiodump.wav test.aac & mplayer dvd://1 -vo null -vc null -ao pcm -channels 6 >/dev/null
rm audiodump.wav

and i got a 6 channels dump or so it seems as mplayer tells me its 6 channels and faac does a clean remapping of the channels.

hope it helped

Last edited by -NoXy-; 28th April 2004 at 08:14.
-NoXy- is offline   Reply With Quote
Old 29th April 2004, 19:58   #3  |  Link
KpeX
Registered User
 
KpeX's Avatar
 
Join Date: Jun 2003
Location: Great Lakes, USA
Posts: 1,433
Thanks for the suggestion, I didn't have time to test until recently. Although the pipe appears to work, unfortunately, the resultant stream is pure static.
__________________
KpeX
Audio FAQs: General | BeSweet | SVCD/MP2 | MP3 | Vorbis | AC3 | DTS | AAC
Linux Audio/Video FAQ
KpeX is offline   Reply With Quote
Old 8th May 2004, 16:25   #4  |  Link
The Shemeta
Registered User
 
Join Date: May 2003
Posts: 51
That works for me. finally i am able to create 5.1ch AAC file. the problem is that faad2 has problem playing them for now. hopefully it will be fixed soon. this is what i used:

mkfifo audiodump.wav
faac -q 75 --mpeg-vers 4 --obj-type Main audiodump.wav test.aac & mplayer dvd://1 -alang en -vo null -vc null -ao pcm -channels 6 >/dev/null
rm audiodump.wav

hope that helps you !

Regards Shemeta
The Shemeta is offline   Reply With Quote
Old 20th May 2004, 11:04   #5  |  Link
hans-jürgen
Registered User
 
hans-jürgen's Avatar
 
Join Date: May 2003
Location: Hamburg, Germany
Posts: 219
Quote:
Originally posted by The Shemeta
That works for me. finally i am able to create 5.1ch AAC file. the problem is that faad2 has problem playing them for now. hopefully it will be fixed soon.
What problem are you referring to? If it's static noise instead of a normal sound (which KpeX mentioned) you have to add -P -X on the FAAC command line, because this will switch to raw PCM mode and change the input byte order to little endian instead of default big endian that is assumed in WAV input. And since your input is probably sampled at 48 kHz with 5.1 channels, you would also need -R 48000 and -C 6, because -P (raw PCM mode) assumes two channels and 44.1 kHz on default.

Quote:
faac -q 75 --mpeg-vers 4 --obj-type Main audiodump.wav test.aac & mplayer dvd://1 -alang en -vo null -vc null -ao pcm -channels 6 >/dev/null
rm audiodump.wav
It seems you're reading the Audiocoding.com forum... Anyhow, you don't need to specify the MPEG version if you use *.mp4/*.m4a as the file extension instead of *.aac. You can do this either with the -w switch and no output file name (defaults to *.m4a then) or with the -o switch and a dedicated output file name (with the new v1.24). Furthermore using the Main object type/profile is not a good idea, because it is not supported by many decoders and sounds a bit buggy with FAAC, i.e. use LC profile (already the default).

Another method to directly transcode from 5.1 AC-3 to 5.1 MP4 on Linux might be the transcoder module in VLC, but I don't know if they handle 5.1 files correctly in the meantime.

@KpeX: What is this stereo-only issue with ffmpeg, do they downmix the AC-3 output somewhere or only use Dolby Surround instead of Dolby Digital? Whatever the cause is, this might also mess up the result when using VLC for transcoding, because they use the ffmpeg library compiled with an external FAAC version, too (see their web forum).

FAAC itself encodes all channels in an input file or bitstream, so it does not downmix or leave out any channels. The -I switch can be used if the channel mapping differs from standard WAV layout, but normally all AC-3 decoders already have them reordered that way at their output.

And other Linux apps which might be able to handle 5.1 AC-3 to 5.1 MP4 transcoding are gmerlin and gstreamer, maybe Xine, too...
__________________
ZZee ya, Hans-Jürgen

BLUEZZ BASTARDZZ on Myspace, YouTube and Last.fm
INDIGO ROCKS on Myspace and Last.fm

Last edited by hans-jürgen; 20th May 2004 at 11:18.
hans-jürgen is offline   Reply With Quote
Old 20th May 2004, 15:18   #6  |  Link
KpeX
Registered User
 
KpeX's Avatar
 
Join Date: Jun 2003
Location: Great Lakes, USA
Posts: 1,433
hans-jürgen:

When I attempted to transcode to AAC using FFMPEG compiled with FAAC, the encoder defaulted to 2-channels (the AC3 was downmixed when decoded) even if I attempted to force the number of channels ( -ac 6 switch ).

I will re-test the Mplayer-pipe method with the additional raw PCM switches, that sounds promising.
Quote:
And other Linux apps which might be able to handle 5.1 AC-3 to 5.1 MP4 transcoding are gmerlin and gstreamer, maybe Xine
I will look into this as time allows . Cheers,
__________________
KpeX
Audio FAQs: General | BeSweet | SVCD/MP2 | MP3 | Vorbis | AC3 | DTS | AAC
Linux Audio/Video FAQ
KpeX is offline   Reply With Quote
Old 20th May 2004, 17:18   #7  |  Link
KpeX
Registered User
 
KpeX's Avatar
 
Join Date: Jun 2003
Location: Great Lakes, USA
Posts: 1,433
Adding the additional FAAC switches resulted in a perfectly transcoded AAC stream. My successfull commandline(s):

$ mkfifo audiodump.pcm

$ faac -q 100 -I 5,6 -P -R 48000 -C 6 -X audiodump.pcm -o audio.aac & mplayer blah.vob -aid 128 -vc dummy -vo null -ao pcm -nowaveheader -channels 6

Thanks to all,

Edit: I have a doubt that the channel-mapping is correct using this command. Unfortunately I will not be able to look into this more at the moment.

Edit2: See below for correct channel-mapping commandline (edited in here as well to avoid confusion)
__________________
KpeX
Audio FAQs: General | BeSweet | SVCD/MP2 | MP3 | Vorbis | AC3 | DTS | AAC
Linux Audio/Video FAQ

Last edited by KpeX; 20th May 2004 at 19:09.
KpeX is offline   Reply With Quote
Old 20th May 2004, 18:47   #8  |  Link
hans-jürgen
Registered User
 
hans-jürgen's Avatar
 
Join Date: May 2003
Location: Hamburg, Germany
Posts: 219
Quote:
Originally posted by KpeX
Adding the additional FAAC switches resulted in a perfectly transcoded AAC stream. My successfull commandline(s):

$ mkfifo audiodump.pcm

$ faac -q 100 -P -R 48000 -C 6 -X audiodump.pcm -o audio.aac & mplayer blah.vob -aid 128 -vc dummy -vo null -ao pcm -nowaveheader -channels 6
Good... For video soundtracks -q 100 usually is too high, -q 75 should be enough (see the thread about FAAC 5.1 settings in the Audio encoding forum). Using the *.aac file extension will result in a MPEG-2 AAC file which might cause problems when muxing it to MP4 without changing this flag to MPEG-4 (e.g. with mp4creator) and trying to play it in QuickTime, because it doesn't know MPEG-2 AAC bitstreams in a MP4 container.

Quote:
Edit: I have a doubt that the channel-mapping is correct using this command. Unfortunately I will not be able to look into this more at the moment.[/B]
It depends what the AC-3 decoder will do: if it doesn't remap the usual AC-3 channel layout to 5.1 WAV, you can use FAAC's -I switch with "2,6" as parameters, because this will define the correct position of the mono channels Centre and LFE. If it does remap to WAV layout, you don't need the -I switch (i.e. "3,4" is the default setting).

By the way, since I'm not a Linux user, I don't understand what mkfifo and mplayer are doing when using this method, but you can also feed the raw PCM bitstream directly to FAAC's stdin when using "-" instead of an input file name, like this: faac -q 75 -P -X -R 48000 -C 6 - -o test.mp4
__________________
ZZee ya, Hans-Jürgen

BLUEZZ BASTARDZZ on Myspace, YouTube and Last.fm
INDIGO ROCKS on Myspace and Last.fm

Last edited by hans-jürgen; 20th May 2004 at 19:08.
hans-jürgen is offline   Reply With Quote
Old 20th May 2004, 19:08   #9  |  Link
KpeX
Registered User
 
KpeX's Avatar
 
Join Date: Jun 2003
Location: Great Lakes, USA
Posts: 1,433
Quote:
Originally posted by hans-jürgen
Good... For video soundtracks -q 100 usually is too high, -q 75 should be enough (see the thread about FAAC 5.1 settings in the Audio encoding forum). Using the *.aac file extension will result in a MPEG-2 AAC file which might cause problems when muxing it to MP4 without changing this flag to MPEG-4 (e.g. with mp4creator) and trying to play it in QuickTime, because it doesn't know MPEG-2 AAC bitstreams in a MP4 container.
I know ....I am familiar with the thread in the audio forum ...this test was on a 30-second surround test file that I use for checking filemapping, and I was using a quick FAAC compile without libMP4, when I actually get around to encoding full movies I will be using more realistic q-settings and a proper FAAC with MP4 support.
Quote:
Originally posted by hans-jürgen
It depends what the AC-3 decoder will do: if it doesn't remap the usual AC-3 channel layout to 5.1 WAV, you can use FAAC's -I switch with "2,6" as parameters, because this will define the correct position of the mono channels Centre and LFE. If it does remap to WAV layout, you don't need the -I switch (i.e. "3,4" is the default setting).
After some quick tests with the Test AC3 2.0 file and Valex's AC3Filter levels meters, the correct mapping switch when using mplayer in this method is -I 5,6. Therefore a full correct-channel mapped command line is:

$ mkfifo audiodump.pcm

$ faac -q 100 -I 5,6 -P -R 48000 -C 6 -X audiodump.pcm -o audio.mp4 & mplayer blah.vob -aid 128 -vc dummy -vo null -ao pcm -nowaveheader -channels 6


The mkfifo command makes a named pipe called audiodump.pcm, which is also the filename mplayer dumps the audio to in this scenario. Although FAAC handles both kinds of pipes well, mplayer isn't as well suited to using stdout.
__________________
KpeX
Audio FAQs: General | BeSweet | SVCD/MP2 | MP3 | Vorbis | AC3 | DTS | AAC
Linux Audio/Video FAQ

Last edited by KpeX; 20th May 2004 at 19:19.
KpeX is offline   Reply With Quote
Old 21st May 2004, 18:56   #10  |  Link
hans-jürgen
Registered User
 
hans-jürgen's Avatar
 
Join Date: May 2003
Location: Hamburg, Germany
Posts: 219
Quote:
Originally posted by KpeX
I know ....I am familiar with the thread in the audio forum
I know that you know, but for any Linux user who might not know, here's the thread:

http://forum.doom9.org/showthread.php?s=&threadid=74708

Quote:
After some quick tests with the Test AC3 2.0 file and Valex's AC3Filter levels meters, the correct mapping switch when using mplayer in this method is -I 5,6.
Strange, that would mean that the AC-3 decoder in mplayer uses a quite uncommon mapping on its output (Centre on 5th position). Anyhow, if it works...

Quote:
The mkfifo command makes a named pipe called audiodump.pcm, which is also the filename mplayer dumps the audio to in this scenario. Although FAAC handles both kinds of pipes well, mplayer isn't as well suited to using stdout.
I see, thanks for the explanation.

By the way, there are also FAAC compiles for Linux and other *nix OS versions available on the web, e.g. on the Debian page of http://www.rarewares.org/, but also on BDP and others that you will find easily with http://rpmseek.com/.
__________________
ZZee ya, Hans-Jürgen

BLUEZZ BASTARDZZ on Myspace, YouTube and Last.fm
INDIGO ROCKS on Myspace and Last.fm
hans-jürgen is offline   Reply With Quote
Reply


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 01:09.


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