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

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st May 2011, 16:48   #1  |  Link
josk
Registered User
 
Join Date: Nov 2004
Posts: 8
on-the-fly AC3 encoding for 6 channel AAC files (mplayer)

My old Yamaha receiver is not able to play 6 channel AAC but just AC3 or DTS audio. So I always on-the-fly encode those 6ch AAC audio tracks to AC3 audio tracks using mplayer-mt (debian).

I just updated mine Debian Lenny to Debian Squeeze and now I have channel mapping issue. AC3/DTS files plays on the correct speakers. So my speaker setting should be ok. When I try to play video file that contains 6ch AAC audio track that is on-the-fly encoded to AC3 audio --> I hear those test sounds on the wrong speakers. Example CENTER is REAR RIGHT etc... Dolby Digital icon lights up always on my receievr so I know that AC3 transcoding is not the problem.

Here is command line example how you can on-the-fly encode multichannel AAC audio track to AC3 track.

mplayer-mt -ao alsa -ac hwdts, -ac hwac3, -af channels=6,lavcac3enc=1:640:3 6ch_aac.mp4

I have put those config options to .mplayer/config file:
Code:
# Device and passthrough
#=====================
ao=alsa:device=hw=0.1
#For both AC-3 and DTS passthroug, use -afm hwac3
afm=hwac3,
channels=6
#lavcac3enc[=tospdif[:bitrate[:minchn]]]
af=scaletempo,lavcac3enc=1:640:3
So I just need to use following command:

mplayer-mt movie_name.avi/mkv/mp4

Test videos:

6ch aac test video: http://dl.dropbox.com/u/26249587/6ch_aac.mp4
6ch ac3 test video: http://dl.dropbox.com/u/26249587/6ch_ac3.avi

I tried to remap those channels but I always lost one channel (Surround Left).
mplayer-mt -ac hwdts,hwac3, -channels 6 -af channels=6:6:0:0:1:2:4:1:3:4:5:3:2:2,lavcac3enc=1:640 6ch_aac.mp4

Now I don’t know hove to solve this problem. I hope someone of you have some tips for me because it worked that way in Debian Lenny and I don't know why those channels are now mapped to the wrong speakers. Also I only have one 6ch AAC test video and I want to be sure that it contains those channels in right order. Can someone test it? If someone have some other AAC surround test files, please, let me know.

-josk

Last edited by josk; 1st May 2011 at 16:54.
josk is offline   Reply With Quote
Old 1st May 2011, 22:09   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Both the AC3 and AAC sample seem to have the correct mapping for me.
sneaker_ger is offline   Reply With Quote
Old 2nd May 2011, 09:06   #3  |  Link
josk
Registered User
 
Join Date: Nov 2004
Posts: 8
Quote:
Originally Posted by sneaker_ger View Post
Both the AC3 and AAC sample seem to have the correct mapping for me.
Thanks! I got an other AAC sample and the problem remains. So the AAC files should be ok.

I don’t know why but at the moment without channel mapping I hear sounds these ways:

My speaker => I hear

FL => FL + LFE
CENTER => FR
FR => SL
SR => CENTER
LFE => SR

Why those channels are in disorder? Any ideas?

I have tried to fix channel ordering and I almost was able to fix all channels. Still the SL is mute and FL plays two different channels.

I think it would help for fixing the issue if I got some clue what is main reason that those channels are in disorder. This situation is only with multichannel AAC files, not AC3/DTS files.

SNEAKER: Could you tell version of mplayer and distro? Or have you combined mplayer by yourself?

Last edited by josk; 2nd May 2011 at 09:09.
josk is offline   Reply With Quote
Old 2nd May 2011, 20:44   #4  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by josk View Post
SNEAKER: Could you tell version of mplayer and distro? Or have you combined mplayer by yourself?
I was supposed to test on Linux? Only tested on windows with MPC-HC and mplayer 33216.

The voice saying the word "LFE" comes from the left front speaker and only the "grumbling" from the subwoofer, btw. That seems to be intended and not an (additional) error in your configuration.
sneaker_ger is offline   Reply With Quote
Old 3rd May 2011, 21:09   #5  |  Link
josk
Registered User
 
Join Date: Nov 2004
Posts: 8
Solved

Problem solved, I remapped my channels and now that 6ch aac on-the-fly-encoding works like it should be!

mplayer-mt -ac hwdts,hwac3, -channels 6 -af channels=6:6:0:0:2:5:1:2:4:1:3:4:5:3,lavcac3enc=1:640 6ch_aac.mp4

That 6:6:0:0:2:5:1:2:4:1:3:4:5:3 means

6:6 => Total 6 channels and I moved those channels 6 times

0=FRONT LEFT (This was OK! So I just copied that channel to itself => 0:0)
1=FRONT RIGHT (I heard SURROUND LEFT, so I moved it to the correct channel => 1:2)
2=SURROUND LEFT (I heard LFE, so I moved it to the correct channel => 2:5)
3=SURROUND RIGHT (I heard CENTER, so I moved it to the correct channel => 3:4)
4=CENTER (I heard FRONT RIGHT, so I moved it to the correct channel => 4:1)
5=LFE (I heard SURROUND RIGHT, so I moved it to the correct channel => 5:3)

So I added this to my .mplayer/config

Code:
# Device and passthrough
#=====================
# Default device  ao=alsa (or u could define more detailed: ao=alsa:device=hw=0.1)
ao=alsa:device=hw=0.1
#For both AC-3 and DTS passthroug, use -afm hwac3
afm=hwac3,
channels=6
#lavcac3enc[=tospdif[:bitrate[:minchn]]]
af=scaletempo,channels=6:6:0:0:2:5:1:2:4:1:3:4:5:3,lavcac3enc=1:640:3
I don't know what is wrong with current mplayer-mt / mplayer2 because it needs channel remapping for 6ch AAC audio. Everything worked just fine in earlier versions of mplayer-mt. So I didn’t have to remap those channels.
josk is offline   Reply With Quote
Old 26th November 2014, 20:17   #6  |  Link
josk
Registered User
 
Join Date: Nov 2004
Posts: 8
Old topic but here is correct syntax if you need it to getting work on MPV (MPlayer fork):
http://shellscreen.blogspot.fi/2014/...coding-on.html
josk 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 00:23.


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