[MPlayer-users] Getting raw audio dumps of each AC3 track

Corey Hickey bugfood-ml at fatooh.org
Mon Oct 16 03:11:36 CEST 2006


Richard Bromley wrote:
> Hello. I have a video with 5.1 Dolby Digital (AC3) sound. I want to
> use mplayer or mencoder to output raw audio (pcm) files for each of
> the 6 tracks. That is, I want one raw audio file for the left track,
> one for the center track, etc.
> 
> I have tried using audio filters as in the following. This is intended
> to write the first track...
> 
> mencoder -af pan=1:1:0:0:0:0:0,format=s16le -oac pcm -of rawaudio -ovc
> frameno foo.avi -o 1.raw
> 
> and this to write the second track...
> 
> mencoder -af pan=1:0:1:0:0:0:0,format=s16le -oac pcm -of rawaudio -ovc
> frameno foo.avi -o 1.raw
> 
> and so on. In this way I obtain six raw audio files, but only the
> first two contain sound; the rest, silence. Obviously my solution is
> incorrect; can someone correct it or provide a better method
> altogether? Help is as always appreciated.

Ask and you shall receive. ...at least, sometimes...

for i in $(seq 0 5) ; do
  mplayer some_file -vc null -vo null -ao pcm:fast:file=$i.wav \
  -channels 6 -af channels=1:1:$i:0
done

Don't worry about the "system too slow" messages.

If you really need raw PCM, add "nowaveheader" to the options for "-ao pcm".

If you need a specific sample rate or format, read the section in the
manual for the "resample" and "format" audio filters; add them after the
"channels" filter.

Once you're sure it's working, you can add "-really-quiet" for a tiny
bit more speed.

-Corey



More information about the MPlayer-users mailing list