MPlayer and OS X - getting the best out of subtitltes


Tip: you might be interested in my DVD ripping guide ^_^

OS X gives you a pretty wide choice of video players and enconders, most of which are base on the ffmpeg project. Quicktime sucks. The last version improved a lot in terms of usability, exporting videos and other features, but it's all Apple centric. You can't play 90% of the video formats unless you install external plugins that integrate the ffmpeg library into it.

Now, let's focus on the real video players, those that support a LOT of formats. The most popular is by far VLC. It's easy to use, it has many features integrated and it's basically ubiquitous, though it's not the best one. The best choice is undoubtedly MPlayer. I won't even spend my time debating on how MPlayer is better, it' just better.

Here's what you need to do: download either MPlayer OSX or compile it yourself (SVN or MacPorts) and install it. Suppose you have downloaded the precompiled OSX version you have now a nice MPlayer icon that opens up a GUI, but also a binary file that you can use for advanced features on the command line.

sudo ln -s /Applications/MPlayer\\ /usr/local/bin/mplayer

It may change if you have a PPC machine in that case will be instead. Make sure /usr/local/bin is in your $PATH. Now open up the ~/.mplayer/config file and add the following:

# =====================
# VobSubs
# =====================
# Align VobSubs (-1: as they want to align themselves)
# Anti-alias VobSubs (4: best and slowest)
# Default VobSub language to select

# =====================
# Text-based subtitles
# =====================
# Find subtitle files (1: load all subs containing movie name)
# Font
# Font encoding
# Subtitle file encoding
# Resample the font alphamap (10: bold black outline)
# Subtitle position (100: as low as possible)
# Subtitle alignment at its position (2: bottom)
# Font size (2: proportional to movie width)
# Font blur radius (default: 2)
# font outline thickness (default: 2)
# Autoscale coefficient of the subtitle (default: 5)

# =====================
# =====================
# Autoscale coefficient of the OSD elements (default: 6)

I attached the file for convenience. As you can see from the comments there are tons of customisations possible. I will take an MKV from the original BluRay of the Film "The lives of others." MPlayer will provide me a verbose information of the container, audio, video tracks and subtitles available, along with many other useful information, such as audio/video codecs, bitrate et cetera.. Let's have a look:

Playing The.Lives.of.Others.mkv.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_AC3), -aid 0, -alang ita
[mkv] Track ID 3: audio (A_AC3), -aid 1, -alang ger
[mkv] Track ID 4: subtitles (S_TEXT/SSA) "Scritte", -sid 0, -slang ita
[mkv] Track ID 5: subtitles (S_TEXT/SSA) "Sottotitoli", -sid 1, -slang ita
[mkv] Track ID 6: subtitles (S_TEXT/ASS), -sid 2, -slang eng
[mkv] Track ID 7: subtitles (S_TEXT/ASS), -sid 3, -slang rum
[mkv] Track ID 8: subtitles (S_TEXT/ASS), -sid 4, -slang swe
[mkv] Track ID 9: subtitles (S_TEXT/ASS), -sid 5, -slang dan
[mkv] Track ID 10: subtitles (S_TEXT/ASS), -sid 6, -slang spa
[mkv] Track ID 11: subtitles (S_TEXT/ASS), -sid 7, -slang hun
[mkv] Will play video track 1.
[mkv] Will display subtitle track 6.

I've got video track, two audio tracks (Italian and German) and 8 subtitles in various european languages. Using the convenient key j i can switch between subtitles, every key on the keyboard has a purpose, which makes it very easy and immediate to interact with the video, especially when it's a complex container format, such as MKV. This command will start the video in German and English subtitles.

mplayer -alang ger -slang eng The.Lives.of.Others.mkv 

The video quality is stunning, I can adjust the audio/video/subtitles delay on the fly, move the subtitles around, fox the brightness and contrast, change subtitles and much more instantly.

MPlayer rocks!