Log in

View Full Version : FFMPEG 5.1 Sound Misplaced


AlanJames1987
8th April 2011, 21:38
When converting video with FFMPEG on Linux from any 5.1 source to an AAC 5.1 destination my channels get mapped incorrectly. I can't figure out what is causing this because I compiled the latest FFMPEG from source. I'm looking for any command line driven solution to fix this, including using external audio converters.

Here is a zip file containing the input I'm testing and the output I am getting.
http://www.alanjames1987.com/development/tron_6channelTest.zip

Please help. I'm at my wits end.

tebasuna51
9th April 2011, 03:35
Your audio input is DTS 5.1, but the AAC output is only 2.0

Sorry I can't help you with Linux soft.

kieranrk
9th April 2011, 04:00
It's because AAC channel order is different to AC-3 channel order. You can use the command line I think to remap the channels.

tebasuna51
9th April 2011, 12:12
It's because AAC channel order is different to AC-3 channel order.

This must be transparent to the user.

Brazil2
9th April 2011, 12:32
It's because AAC channel order is different to AC-3 channel order. You can use the command line I think to remap the channels.
AFAIK channel order for AAC 5.1 is C, L, R, SL, SR, LFE.
More info in this thread: http://forum.doom9.org/showthread.php?t=148178


This must be transparent to the user.
Should be but it's not always true depending on the tools being used :)

AlanJames1987
9th April 2011, 15:28
Your audio input is DTS 5.1, but the AAC output is only 2.0

You're right. I must have uploaded the wrong file. Its fixed now though. Both files in the zip are 5.1.

AFAIK channel order for AAC 5.1 is C, L, R, SL, SR, LFE.

Thank you. I believe that is the correct channel order. Now I just don't know what programs to use to get that channel order in my output file. FFMPEG seems to export all other 5.1 formats correctly, just not AAC.

kypec
10th April 2011, 15:11
For all my transcoding/encoding needs audio-wise I try to use eac3to - remapping channels between AC3/DTS/AAC (NeroAacEnc used) has never been a problem for me.

AlanJames1987
10th April 2011, 17:40
eac3to is a Windows program. I am looking for a Linux solution. I hear SoX does nearly the same thing as eac3to but I don't know how to use it. Does anyone have experience with SoX?

poisondeathray
10th April 2011, 20:19
audacity is available for linux, so you should be able to specify the channel order in that

AlanJames1987
11th April 2011, 01:13
Thanks but I am looking for a command line solution. I should have explained in my op that I am trying to convert a few hundred movies for work. I'm a video editor at an advertising agency and we are trying to put our entire portfolio online.

kypec
11th April 2011, 06:11
I've no experience with Linux whatsoever but have you tried running eac3to through wine?

Midzuki
11th April 2011, 06:39
sox has an option called "remix" which may give you what you're looking for...

{ source: sox.pdf :rolleyes: }

AlanJames1987
11th April 2011, 16:55
The remix option is what I am looking for. I can't seem to get it working however and the man pages don't describe how to use it. I also can't find any good documentation online of how to use it.

Also, I submitted a bug report for FFMPEG so hopefully this problem I am getting will be fixed in the trunk.

J_Darnley
11th April 2011, 20:53
The sox man page on its website is no good?

This would do nothing: sox INPUT OUTPUT remix 1 2 3 4 5 6
This would reverse stereo: ... remix 2 1
So all you have to determine is which channel order your input is then order them correctly for the output

AlanJames1987
15th April 2011, 14:49
Thank you. The man page wasn't very helpful. I tried what you suggested before suggesting sox and could not get it to work. I was hoping to get some help from someone who has done it before.

An example of a problem I'm having is that sox only accepts audio files. How can I separate audio from the video while still preserving the quality and correct channel order? What format should I export to and convert to? Then how do I then merge that outputted audio file back with the original video file. I have a decent understanding of all of these questions. I just can't seem to get any of the specifics correct.

tebasuna51
15th April 2011, 17:58
Demux/Mux streams from a container is specific to the container.

Then to extract/mux from/to mkv you have MkvExtract/MkvMerge (in MkvToolnix, I don't know GUI's for Linux), the quality is always preserved and the channel order isn't changed in this level.

For mp4 you have Mp4Box (I don't know GUI's for Linux)

The ffmpeg dts decoder seems ok (with my windows SVN-r25870-Sherpya version the audio.wav have correct channelmap) with:
ffmpeg -i input.dts -acodec pcm_s16le -ac 6 audio.wav

but converting to aac:
ffmpeg -i input.dts -acodec aac -ac 6 -strict experimental audio.aac
the output is absolutely wrong

I think you can convert the decoded audio.wav with NeroAacEnc (there are a Linux version)

AlanJames1987
16th April 2011, 06:35
Thank you for all the help but I have come to the conclusion that I'm not going to get the help I need on here. I have submitted a bug report to FFMPEG. Hopefully they will solve this problem soon.

tebasuna51
16th April 2011, 10:49
...I have submitted a bug report to FFMPEG. Hopefully they will solve this problem soon.
Good luck!