27/07/2014

[Linux] MPlayer 5.1 AAC to AC3 encode on the fly

Mplayer is arguably the most powerful media player for Linux, but unlike VLC, it lacks an intuitive and powerful configuration GUI (though SMPlayer is amazing).

Thus, in order to set it up correctly, you'll need to fiddle both with the GUI and some old-school text file configuration.

First, install it as (for Ubuntu/Debian):

sudo apt-get install mplayer2 smplayer

Then check you have some output like this:

lavcac3enc     : runtime encode to ac3 using libavcodec

when you run this command:

 mplayer -af help | grep lavcac3enc

Now, to have it encode a 5.1 AAC audio track to AC3 on the fly, you'll need to:

configure via GUI (SMPlayer):

- disable the audio equalizer under Preferences->General->Audio
- enable AC3/DTS pass-through S/PDIF under the same section
- add this parameter:

lavcac3enc=1:640

under Advanced->Options for MPlayer->Audio filters

configure via text file by editing ~/.mplayer/config:

ao=pulse
afm=hwac3,
channels=6
af=scaletempo,lavcac3enc=1:640:3

I'm using pulse since alsa gives me nearly 2 seconds of audio delay, but if you wish you can use it by setting instead:

ao=alsa

No comments:

Post a Comment

With great power comes great responsibility