Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: 5.1 AAC troubles in Linux (Read 3456 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

5.1 AAC troubles in Linux

I am using Linux and I can't seem to be able to encode a raw 5.1 AC3 file to 5.1 AAC correctly. One major problem is that I don't actually have a 5.1 sound system so I can't easily tell how well the audio has been encoded, but of course I am encoding it as 5.1 for the possibility that I will get a 5.1 system in the future. It is a good idea to be future-proof

I have searched on google dozens of times trying to find out how to do this correctly. I have found a vast amount of information, however I have big problems with the channel mapping. I can use MPlayer to pipe the raw audio to nero aac, but the channels are always wrong. What I assume should be heard in both speakers (because that is what it is like when I play the raw ac3 file in VLC) is only heard in one. I have found I think at least 3 different channel remapping schemes (like -af channels=6:6:0:4:1:0:2:1:3:2:4:3:5:5) but they don't seem to correct this either.

I've also been trying different channel mappings with faac. I actually came up with one that seems to work (-I 3,6) even if I dont think it was on any site. The problem is that it is faac when I think nero aac is shown to be better in any listening tests that I have seen (but I think they were old, there might be new improvements that I am unaware of), and that while it seems to play fine in VLC, in mplayer the speaking is just from one of my two speakers. This might be fine but I think it would be better to find a way that works in most players, if it is possible. I dont think it would be good to be constrained to just one media player when there are different times when I would want to use each one.

I have also tried using foobar2000 with wine to encode it (foo_ac3.dll and neroaacenc.exe). I was expecting it to work great. It did work in mplayer, but not VLC. I suspect some of the first encodings that didn't work in VLC will actually work in mplayer, but I haven't tried them. I have also tried unsuccessfully to get BeLight or BeSweet working on linux with wine but I haven't had any luck.

Whenever I have said in this post that something seemed to work in a player, it isn't for sure because I don't have a vast knowledge of 5.1 (what comes out of what channel) and as I said I don't have 5.1 sound system. I can mostly just go by if the voices are in both of my two speakers when played or just one and how it compares to the original ac3 when being played.

Does anyone know of the holy-grail of 5.1 AAC encoding on Linux? Or does anyone have any information on why some encodings seem to work in VLC but not mplayer or vice-versa? It would be greatly appreciated. If you need any more information on how I did some encodes then don't hesitate to ask  I hope I have properly explained everything that I have done.

5.1 AAC troubles in Linux

Reply #1
I don't have the end-all answer, but there are some things that might help you out:

NeroAACEnc requires standard MS wave file ordering as input. This is not the same as the order in an AC3 or AAC file (and those 2 don't match either).

Normally I would say your foobar2000 setup at least produces a file that has the correct file ordering in the AAC file. But the AC3 decoder might already be the cause of the incorrect channel order. Get the 6_channel_id file from here: http://www-mmsp.ece.mcgill.ca/Documents/Au...VE/Samples.html
If this also doesn't work properly you rule out the AC3 decoder.

Since your 2 players produce different results it is most probable that one of them produces incorrectly ordered channel output (or maybe the downmix to 2 channels is broken?).
Again, try using the 6_channel_id file to figure out the problem. All left channels should end up in your left channel, center should be in both left and right, etc. It should make it easier to determine what part of the chain is at fault. Nero encoding that wave file produces a 5.1 AAC file that is definitely correct when it comes to channel ordering.

 

5.1 AAC troubles in Linux

Reply #2
That file looks to be very useful. It plays perfectly fine directly with VLC, but with mplayer it only plays the front right and front left channels (on the correct sides). That is from the GUI. This is very odd though; I tried it in the CLI and I got only the back left and back right. I then did the same command and it was the front left and front right again. I'm going to take a look at the mplayer documentation to see if downmixing is mentioned; maybe I have to add a command parameter to get it to do it right.

When encoding that file with foobar2000 the front left, back left are on the right. Back right is center. Front right and center are on the right.

Now I will test encoding it with mplayer piping it to nero aac and do some encodes to try and figure out an "-af channels" configuration that produces a file with all of the channels in the right place (but it is based on putting channel 1 to channel 3 and so on which is harder than if it was based on putting a named channel to another named channel's place, but I understand why it isn't like that; I also think distinguishing between the back and front of each side might be a bit hard , I can probably find a useful setting in VLC somewhere that will help). Thank you very much for the help, I really appreciate it

EDIT (a day later): Finding the correct "-af channels=" parameter for mplayer seems to be much harder than I thought. Does anyone know what it is? Would it be the same for encoding from that uncompressed file as it would be from a typical AC3?