[MPlayer-users] Cache usage in mplayer

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Dec 30 20:51:44 CET 2009


On Wed, Dec 30, 2009 at 05:51:33PM +0100, Jorge Gascon Perez wrote:
> So, the solution of using:
> 
>               dd if=my_video.mpeg ibs=10M obs=10k | mplayer - -cache 10000
> 
> Is very useful and very recomended for slow media (the unique drawback
> is that you cannot seek in the file).

I does not make the slightest bit of sense at all for slow media.

> Do you consider adding a new option to mplayer which emulates the "dd
> if=my_video..." but with the hability to seek
> files?  Do you consider if this could be useful?

You should be able to get quite far along that road by setting a rather
huge read-ahead in the kernel without hacking every application.

> I think that this capability could be good, specially for slow and
> network media.

You'd really have to explain that, I think I explained quite well why it
would be quite horrible for slow media (the spinup makes it only far
worse for CDROM, but it also applies to anything else).
But just in case let me make a different example.
Assume you have a 110 kB/s video stream and you have a 100 kB/s
connection, duration 1 hour movie.

Current code:
Use a 80 MB cache, wait about 6 minutes for it to fill and the movie
plays through till the end.

Your proposed method:
80 MB cache fills up, playback starts, no further reads are done.
After 12 minutes the cache is below the 10%, starts reading again.
However after another 12 minutes the cache is empty regardless and
stuttering begins.

In the hope that maybe next time someone remembers it: If you want a
feature, please describe exactly which problem you want to be solved.
In particular, first decide _what_ you want, then start thinking about
implementations, don't first suggest an implementation and then try to
come up with uses for it.
And most important at all: if something doesn't work first report a bug,
unless maybe if you are a programmer and intend to implement a solution
right away (and even then only if you don't consider it wasted time if
the end result is useless).

(sorry for the rant but it happens all too often that someone asks "hey,
why don't you implement (huge, complex) feature a" just to find out
after some discussion that just spending 5 minutes to fix some bug b
solves their problem far better)


More information about the MPlayer-users mailing list