AnimeSuki Forum (
-   Playback Help (
-   -   Help getting softsubs to work in MPlayer? (

RichD 2007-07-18 16:03

Help getting softsubs to work in MPlayer?

I've recently installed Ubuntu Feisty, and spent what seems like forever trying to get one of the main media players to work properly with MKV files. I've read a few posts from these forums which say it just ain't gonna happen with VLC - so I'm prepared to let that one go out the window. But I also can't get them working properly in MPlayer, and I've seen some people here say that it works almost flawlessly with something called libass.

I can't find anything called libass in Synaptic (including on Medibuntu), and my Google searches mostly take me back to threads in here. Can someone help me figure out where I'm going wrong please?

I've looked in my /.mplayer folder and opened the config file in gedit, but it's empty. It just says "write your default config options here". I also tried starting the application through the command line but got an error saying "error parsing option on the command line: -profile."

For background, my problem with Mplayer's sub handling is that when two lines are spoken simultaneously by different characters, or two different sets of subtitles come up in opening credits, only one such line appears. For comparison, in VLC both appear right on top of each other!

I'm really hoping someone can help me here, as I'd rather not have to go back to Windows just to watch my anime... thanks in advance for any help.

Nicholi 2007-07-19 01:36

Indeed your problem does have a solution, no fear. Libass is part of mplayer itself, you'll find it in their SVN. In order to have mostly complete working subtitles in mplayer it must be built with both freetype (this is required by libass) and fontconfig (required to use embedded fonts). However I am guessing you are not building mplayer yourself, so that may pose a problem depending if the build you are using already has support for those.

Run the -ass parameter when you play a file, which will enable libass rendering. Or set ass=true in your config file, which means libass will be enabled at all times. If the build supports it you should be getting basic support for SSA/ASS (also libass is used for SRT in Matroska), which means everything short of fonts will be working. Those subtitles you saw which display at the same time should be placed correctly on the screen/whatnot is done in the sub script itself. If fontconfig was also built you do not need to enable -fontconfig parameter, it is automatically enabled with -ass, however you do need to use -embeddedfonts. Then if the script calls for any other fonts, and they are embedded in the file, they will be used. Finally sort of a partial fix to make subs exactly frame accurate, you need to use -correct-pts-true. Only important if you are fanatical about the subs being accurate to the video, otherwise they are 1-2 frames off.

RichD 2007-07-19 02:18

Thanks for that - I'll try your suggestions tonight if I get a chance. I'm not sure what build of MPlayer I'm using, I just installed the one called 'MPlayer' from Synaptic, so I might have a build that's not complete... if there's a different one I should be using, or any other repositories I should be getting it from, please let me know.

When you say add ass=true into the config file, do you mean simply add a line which reads "ass=true" into /home/myname/.mplayer/config ? Like I said, that file is empty at the moment - is it meant to be?

Thanks again...

Nicholi 2007-07-19 07:04

Yes that file is meant to be empty and that is where you would put any of the parameters from the commandline, if you wanted them to be on every time you run mplayer. Anything/everything from the giant manpage can go in there. Also you can make "profiles" which will run a group of options at once if you call the profile. Like this:


Which you then run as "mplayer -profile libass", and it automatically runs those three. Sometimes it is useful if it's something you don't want turned on all the time.

I don't really know where to get reliable *nix builds of mplayer, I'm stuck h'yah on Winblows afterall :). It is fairly simple to build on it's own...some of the extra libs might give you problems though. If freetype is a dependency of that Synaptic MPlayer build then you at least have libass rendering. And if fontconfig as well, then you can use embedded fonts.

RichD 2007-07-19 15:27

Excellent!! Thanks so much - it's now actually even working better than MPC in Windows, as it turns out the blue and red Japanese text during the opening credits is karaoke text, which is now actually working instead of being static.

Can I set default preferred languages for audio, and have subtitles on as default? Also is there an information repository online so I can find this for myself instead of bothering you guys for every little question? :)

TheFluff 2007-07-19 17:12


Originally Posted by RichD (Post 1050331)
Can I set default preferred languages for audio, and have subtitles on as default? Also is there an information repository online so I can find this for myself instead of bothering you guys for every little question? :)

Yes, yes and yes.

1. In the config file:

would mean preferred audio language Japanese, if that isn't available use English, and if that's not available either try Swedish. If none of the listed are available fall back on the file default. I leave figuring out how to tweak this as an exercise to the reader. :V

2. In the config file:

means "display English subtitles if available". However, not all files have proper language tags, so you may be better off with

which just means "display the first subtitle track, if any".

3. In your favorite shell:

man mplayer
Or visit

RichD 2007-07-20 14:10

Many thanks!! sid=0 didn't work, but slang=eng has been ok so far. I'll look through the man page to see what other nifty stuff I can do...

SeijiSensei 2007-07-20 14:34

You might want to visit and use mplayer and similar items from there instead of the Synaptic defaults. They worked flawlessly on my daughter's new Ubuntu laptop.

Togop 2011-04-22 07:57

Sorry for bringing up such an old thread, I recently started using mplayer for animes because I have a netbook (with low specs, of course) and this is the only player to play mkvs decently.
However, it doesn't display the stylized subtitles properly (especially the karaoke). When I use -ass -embedded, the karaoke appears normally, however, it starts dropping behind (the subtitles advance a lot more slowly then the song). [edit: this sentence is wrong: When the opening song is over, the subs start appearing normally again.] correct-pts=true doesn't help. Can I fix this or I would have to give up the karaokes?

EDIT: Actually, not only the karaokes seem broken that way - all the subs get delayed. And it's not bad subs - all the other palyers play them correctly.

SeijiSensei 2011-04-22 08:20

First, are you running Windows or Linux? What kind of netbook with what kind of video card? If it's an Atom-based machine with Intel graphics, I think you're going to find it difficult to watch some recent shows. OPs with karaoke are often especially demanding. (If you have an ASUS with NVIDIA graphics and are using Linux, install the proprietary driver for your video card, and try using "-vo vdpau". That will make mplayer use the graphics card's hardware to decode H.264 video and will speed things up immensely.)

That said, I recommend installing smplayer, a great graphical front end to mplayer. There's a Windows version here; most Linux distros like Ubuntu or Fedora have smplayer in their repositories. It will let you control a lot of mplayer's features from dialog boxes.

Adding "-lavdopts skiploopfilter=nonkey:fast" might help, too. You can also try replacing "nonkey" with "all" or omitting ":fast".

You might also try the recent fork of mplayer, called mplayer2. You'll find binaries for most platforms at the bottom of that page. It uses a more recent version of libass so you might find it displays the subtitles better. If you're running Ubuntu, I posted some instructions for compiling and installing mplayer2 from its source code here.

Togop 2011-04-22 08:38

Asus EEEPC 1000H (I'm not sure the exact specs, it has Atom 1.6 GHz) and Fedora. MPlayer plays the file great (no lag), just when I enables -ass and -embedded the subtitles start dropping behind. I don't see how can that be because of low specs.

SeijiSensei 2011-04-22 08:53

You have an Intel 950 GMA adapter, not known to be a graphics powerhouse by any means. Try mplayer2 and see if the newer libass helps. You might also give "-ass-hinting 0" a try with your current setup. It could be that decoding and formatting the subtitle stream along with the video and audio streams pushes the CPU to its limits. That little Atom isn't a powerhouse, either.

Open a terminal window and run "top", then play the video in another window. See what happens to the CPU load when you change different settings or watch different parts of the video. Running mplayer from the command prompt ("mplayer /path/to/file.mkv") will report a lot of useful information as well. If you get the "your system is too slow to play this" error, try some of the suggestions it lists there.

Togop 2011-04-22 10:28

I tried this suggestion by mplayer:
-vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all

however I get this log:
#> mplayer \[Victorique\]_Gosick_-_05_\[h264-720p\]\[48A2CC96\].mkv -ass -ass-hinting 0 -embeddedfonts -lavdopts lowres=1:fast:skiploopfilter=all

================================================== ========================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
================================================== ========================
================================================== ========================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
================================================== ========================
AO: [pulse] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
*** glibc detected *** mplayer: corrupted double-linked list: 0x0b808460 ***

and it doesn't play anything

All times are GMT -5. The time now is 20:04.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.