hacks

0

MPlayer and OS X - getting the best out of subtitltes

MPlayer

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\ OSX.app/Contents/Resources/External_Binaries/\
mplayer_intel.app/Contents/MacOS/mplayer /usr/local/bin/mplayer

It may change if you have a PPC machine in that case mplayer_intel.app will be mplayer_ppc.app 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)
spualign=-1
# Anti-alias VobSubs (4: best and slowest)
spuaa=4
# Default VobSub language to select
slang=en,eng,it

# =====================
# Text-based subtitles
# =====================
# Find subtitle files (1: load all subs containing movie name)
sub-fuzziness=1
# Font
font=/Library/Fonts/Verdana.ttf
# Font encoding
subfont-encoding=unicode
# Subtitle file encoding
utf8=yes
# Resample the font alphamap (10: bold black outline)
ffactor=10
# Subtitle position (100: as low as possible)
subpos=100
# Subtitle alignment at its position (2: bottom)
subalign=2
# Font size (2: proportional to movie width)
subfont-autoscale=2
# Font blur radius (default: 2)
subfont-blur=1.0
# font outline thickness (default: 2)
subfont-outline=1.0
# Autoscale coefficient of the subtitle (default: 5)
subfont-text-scale=4.0

# =====================
# OSD
# =====================
# Autoscale coefficient of the OSD elements (default: 6)
subfont-osd-scale=4.2

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!

Syndicate content