MPlayer Audio Track

Identify And Select

Using MPlayer on the command line, sometimes a movie defaults to, and plays the wrong audio track. How do you identify the correct track? How do you select the correct audio track?

First check the audio tracks available on your movie. This one is in matroska (mkv) format.

$ mplayer -identify greatmovie.mkv
[matroska,webm @ 0x374eae0] max_analyze_duration reached
[matroska,webm @ 0x374eae0] Estimating duration from bitrate, this may be inaccurate
ID_VIDEO_ID=0
ID_AUDIO_ID=0
ID_AID_0_LANG=eng <-- Here's the audio we want!
ID_AID_0_NAME=English
ID_AUDIO_ID=1
ID_AID_1_LANG=eng
ID_AID_1_NAME=Commentary actor, director
ID_SUBTITLE_ID=0
ID_SID_0_LANG=eng
ID_SID_0_NAME=English
ID_SUBTITLE_ID=1
ID_SID_1_LANG=eng
ID_SID_1_NAME=English (SDH)
ID_SUBTITLE_ID=2
ID_SID_2_LANG=fre
ID_SID_2_NAME=French
ID_SUBTITLE_ID=3
ID_SID_3_LANG=spa
ID_SID_3_NAME=Spanish
ID_CLIP_INFO_NAME0=title
ID_CLIP_INFO_VALUE0=gr
ID_CLIP_INFO_N=1
ID_FILENAME=greatmovie.mkv
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=H264
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=1280
ID_VIDEO_HEIGHT=528
ID_VIDEO_FPS=23.976
ID_VIDEO_ASPECT=2.4242
ID_AUDIO_FORMAT=22127
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_START_TIME=0.00
ID_LENGTH=6162.19
ID_SEEKABLE=1
ID_CHAPTERS=0
ID_VIDEO_CODEC=ffh264
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_AUDIO_CODEC=ffvorbis
ID_VIDEO_ASPECT=2.4242 <-- Here's the aspect ratio!
ID_PAUSED
ID_EXIT=QUIT

Now we have the audio track details, we can pass that value to MPlayer when we start the movie:

mplayer -aspect 2.42:1 -aid 0 greatmovie.mkv

MPlayer will now play the audio track we want.

Done!