[MPlayer-dev-eng] mencoder variable FPS

Michael Niedermayer michaelni at gmx.at
Sun Jan 7 19:19:20 CET 2007


Hi

On Sun, Jan 07, 2007 at 04:41:03PM +0100, Guillaume POIRIER wrote:
> Hi,
> 
> On 1/7/07, Keith Chew <keith.chew at gmail.com> wrote:
> >Hi Nico
> >
> >After running mencoder for 4 days, I found that it has eaten up 400+
> >MB of memory. Can you guide me as to where to look for this memory
> >consumption? I am going to look through mencoder.c and demux_avi.c,
> >are there other places that I should be looking at?
> 
> Valgrind is your friend to pursue this task

a piece of paper and a pencil are also an interresting choice ...

30 fps, 3600 seconds per hour 24 hours per day
4days -> 30*3600*24*4 frames = 10368000 frames or about 10 million
now you need to store stream number, frame size, keyframe flag and the
position for each of them so you can write the index at the end
i dunno how effective mencoder stores these in memory but a simple
int for flags, stream_id and size and a int64_t for position already
provide for 4+4+4+8=20bytes which would account for 50% of the observed
"memory leak" and if the file has a audio stream then that needs some
space too ...

note, ODML allows indexes to be split and stored at arbitrary places in
the file, libavformat does store one after X bytes, mencoder apparently not?
spliting the index helps the seekability with truncated files (in theory,
in practice lavf stores them too rare, though id guess a single line change
could fix that ...) and of course means O(1) instead of O(n) memory
requirement

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070107/fefc9970/attachment.pgp>


More information about the MPlayer-dev-eng mailing list