Subject: Re: mplayer, movies.
To: Richard Rauch <rkr@olib.org>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-help
Date: 05/12/2003 22:19:11
On Mon, 12 May 2003, Richard Rauch wrote:

> I had the need to update pkgsrc and rebuild some stuff.  Fortunately, in
> the avalanche of resulting package rebuilds, everything built.  Unforunately,
> mplayer no longer works quite right (it was one of the packages that got
> rebuilt).
>
> It works okay for perhaps up to the first hour, say, then starts to get
> jumpy/glitchy and shortly exits/crashes.

Probably the most relevant change lately, is that the build is no
longer optimized for the build host (mostly so we can build binary
packages). You can turn that back on for yourself by setting
MPLAYER_ENABLE_RUNTIME_CPU_DETECTION=NO in "/etc/mk.conf".

> I tried various -ao and -vo mplayer options.  One of them (I forget
> which; an audio driver option, I think) seemed to let me play the movie
> without lossage but resulted in *continual* audio skips that made the
> whole unacceptable.

I find I get best results with "-ao sun -autosync 30 -vo xv" on
the Voodoo 3, and on the ATI Mobile, which doesn't do the XVideo
extension, "-vo dga" (as root).

> Because it can't keep perfect synch with 100% of the frames, my guess is
> that it is using up some finite (or not properly freed) resource whenever
> it has to resynch.  (This would explain why it gets worse and worse for
> later and later in the movie; unfortunately, I can't see how to skip to
> N percent or N minutes into the movie, so there's no way to just restart
> "the second reel" neatly; each successive failure requires more manual
> skips to get back to where I was.)

I think the "resource" that's being used up is the video buffer. Common
wisdom is to set that to 500kb when encoding for software playback. I
have noticed, though, that when I transcode to a much lower value in order
for it to play properly on my DVD player, that it also plays very smoothly
on the K6-2 500, even while the box is heavily loaded (transcoding, say).

For a real DVD, you can skip to a ~15 minute chapter, with "-chapter
N", or for any stream, skip to a certain time, with "-ss NN:NN".

> Anyone have similar experiences to share?  Are there any suggestions
> about ways to twiddle options to mplayer to make it work again?
> (I got about 18fps with the "old" mplayer, which was not ideally smooth,
> but acceptable to me.  The rebuilt mplayer would be a lot better for
> short movies (up to about an hour, maybe) by getting apparently close
> to 24fps, but for general movies it is just not acceptable anymore due
> to eventual crashes/implosions.)
>
> Oh, the CPU is an Athlon 800MHz, and I'm running a pretty generic
> 1.6 system with a custom kernel.  The only other thing (that shouldn't
> matter as far as I know) is that the computer exports an NFS mount or
> few.  (But the NFS activity is low in general.)

That should be plenty fast enough. I'm actually running the current
CVS version of mplayer built with gcc-3.2.3, optimized for the K6-2,
and without the SDL baggage, but that machine is widely recognized as
marginal for video, so every little bit helps. It does pretty well
with SVCD or so, but HQDivX is out of the question. The laptop, a PIII
800, does OK with actual DVD's with only the unaccelerated "x11"
driver, but the software zoom drags it down a bit.

It also seemed to help, a lot, to compile the kernel with submodel
optimization. I'm currently running 1.6.1/i386, built with gcc-3.2.3,
"-O3 -march=k6-2". For your athlon, it might be reasonable to at least
try "-O2 -mcpu=686".

Frederick