[MPlayer-users] MPlayer memory leak with lavc output

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Jun 7 22:03:38 EEST 2017


On 25.05.2017, at 13:22, Michael Kohne <mhkohne at moberg.com> wrote:

> I'm seeing a memory leak with mencoder when capturing data from a USB
> video camera and outputting to a file using -ovc lavc:
> 
> ./mencoder tv:// -tv
> driver=v4l2:noaudio:device=/dev/video0:width=640:height=480:fps=60 -o
> /tmp/outtest.avi -ovc lavc
> 
> I've tested with MPlayer-1.3.0 and with last night's build
> (2017-05-24). In both versions I get a memory leak of over
> 100K/minute.
> 
> mplayer playing from the same camera:
> ./mplayer tv:// -tv
> driver=v4l2:noaudio:device=/dev/video0:width=640:height=480:fps=60
> Does not have a memory leak.
> 
> 
> The video camera is an e-con See3CAM, but we see the same problem with
> an older Philips camera as well.
> 
> I can provide mencoder output for a short run if that's helpful (I
> couldn't attach logs due to message size limits).

valgrind is the most useful tool to debug the leaks it should (after e.g. aborting the command) tell quite clearly where all the memory was allocated.
It is however fairly likely it is not a leak.
Typical things that look like a leak:
- index data for AVI which must be kept in memory and written at the end. It can get really large due to issues with "variable" frame rate or some audio codecs in AVI
- audio and video are getting out of sync, requiring one to be buffered a lot. Playing the file while recording might show it by one or the other ending earlier. -noskip -mc 0 usually avoids the leak, but not other issues.


More information about the MPlayer-users mailing list