[nSLUG] MPlayer subtitle problem

Daniel Morrison draker at gmail.com
Wed Apr 24 04:44:32 ADT 2013

On 2013-04-24 02:35, mspencer at tallships.ca wrote:
> I think I have a movie with working subtitles!


I'd be happy to answer mplayer encoding questions any time. I've delved
into it quite deeply. I highly recommend this document:


which is huge, but at the end your movie rip will be perfect. The man page
is also quite good (and very long).

However I will admit that interlacing is the hairiest subject of them all
and unfortunately, the person with the DVD has to do the work to figure it
out! All guesses without access to the source material are, well, just
guesses. Take a look at pullup and softskip in the man page, I think.

If you use '-frames 240', mencoder will do only 10 seconds (@24fps) then
quit. You can also use edl (edit decision list) commands to make mencoder
encode only 10 seconds from a particular scene, as a test. Although I've
always found mplayer's edl system a bit buggy...

The '-ni' seems applicable to .avi playback, not encoding, so I'm not
certain it really did anything...?

It occurs to me right away that you're directly encoding the video without
any scaling. This probably results in the highest quality, but 1) most
times a re-encode into mpeg4 is scaled down to make the file size
manageable, e.g. 700MB movie, and 2) you're encoding at DVD native
resolution (720x480), which is almost certainly not the correct aspect
ratio if the DVD is anamorphic (most films are). There is an mplayer
specific hack that allows mplayer to preserve the aspect ratio so you may
not have noticed this (although I thought it took effect only if you
specified the 'autoaspect' option?). But it doesn't work for any other
player. You can also get around this by using a modern container format
like .mkv instead of the ancient .avi.

Normally when ripping movies (to .avi) you would explicitly rescale to an
appropriate size and aspect ratio assuming square pixels, e.g. -vf
scale=640:352. Note 352 is divisible by 16. This takes precedence over
getting an exact 16:9 aspect ratio (should be 640:360, but 360 is not
divisible by 16...)

I also recommend two-pass encoding. Using -lavcopts ...:vpass=1:turbo -o
/dev/null makes the first pass fast. It writes a log file used to optimize
bit use for the second pass: -lavcopts ...:vpass=2 -o final.avi

Many guides also recommend the 'trell' option for quality, and if you're
going to use mbd>0 you may as well turn on v4mv. (Not that I really know
what these things do; just paraphrasing the man page).

Here's a sample (second pass) of the options I've used in the past (no I
don't remember what most of these do and they may not be optimal but I did
look them all up at one time, and I've followed my recipe notes ever since):

mencoder -oac copy -ovc lavc -lavcopts
-vf pullup,softskip,hqdn3d=3:2:5,scale=448:256 -o /dvdimages/ep1.avi dvd://

This was fitting a 45 minute widescreen tv episode from DVD into 350 MB,
preserving original 5.1 audio. I've often done audio encoding to .mp3 along
with the video if it's just stereo, but for surround I think it's better to
do -oac copy as you have done.

Have fun!


> Haven't watched all
> the way through (tomorrow night's movie with Peggy :-) but it sails
> right past the problem spot, correctly displaying subs, in sync, from
> the .srt file.
> The successful incantation was to rip the movie from the DVD with:
>         mencoder dvd://1 -ni -o henry.avi -oac copy -ovc lavc \
>                  -lavcopts vcodec=mpeg4:mbd=1:vbitrate=1800
> arrived at by cook-booking from the manpage plus trial & error.  Tried
> some other incantations first, all of which slowed to a snail's pace
> about halfway through the movie and/or emitted error
> messages. Guessing (from mencoder messages) that it was the -ni (no
> interlace) that fixed it, possibly at the expense of not-quite-perfect
> video. Mencoder remains intimidating, what with so many options that I
> don't understand and having to wait for an hour's hard CPU grinding to
> see if some row of command line hen tracks worked.
> But in any case, I didn't have to hard-write the subs into the .avi
> file. HenryV.avi is now dribbling across my tediously slow LAN to the
> computer with the nice big CRT monitor.
> Tnx for help and pointers,
> - Mike

Q: How many NRA spokesmen do you need to change a light bulb?
A: More guns.

What is not surrounded by uncertainty cannot be truth.
               -- Richard Feynman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/mailman/private/nslug/attachments/20130424/fe1f03af/attachment.html>

More information about the nSLUG mailing list