Bug 128404 - mjpegtools-1.8.0-r1 - lavrec runs out of memory while recording
Bug#: 128404 Product:  Gentoo Linux Version: 2006.0 Platform: x86
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: media-tv@gentoo.org Reported By: lenzth@gmx.de
Component: Applications
URL: 
Summary: mjpegtools-1.8.0-r1 - lavrec runs out of memory while recording
Keywords:  
Status Whiteboard: 
Opened: 2006-04-01 09:59 0000
Description:   Opened: 2006-04-01 09:59 0000
The following command consumes more and more memory; after < 1 h, 512 MB Ram
are used up and lavrec crashes. The latest version (lavtools 1.8.0) still has
this problem.

<example>

avalon dvd #  lavrec -f a -i P -g 352x288 -t 7200 -q 80 -R m -l 85 -r 48000 -a
16 --software-encoding junk%02d.avi

**ERROR: [lavrec] Error reading audio: Audio task died. Reason: Error Audio
ring buffer overflow
++ WARN: [lavrec] Closing file(s) and exiting - output file(s) my not be
readable due to error
0.48.47:01 int:883 lst:  0 ins:935 del:380 ae:  0 td1=0.113 td2=1.811
Recording time  :  0.48.47:01
Lost frames     : 000
A/V sync ins/del: 935/380
Audio errors    : 000

</example>

Here's my emerge --info:
avalon dvd # emerge --info
Portage 2.0.54 (default-linux/x86/2005.1, gcc-3.4.5, glibc-2.3.5-r3,
2.6.15-gentoo-r1 i686)
=================================================================
System uname: 2.6.15-gentoo-r1 i686 Pentium III (Coppermine)
Gentoo Base System version 1.6.14
ccache version 2.3 [disabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium3 -fforce-addr -fomit-frame-pointer -ftracer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium3 -fforce-addr -fomit-frame-pointer -ftracer -pipe
-fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="de_DE@euro"
LC_ALL="de_DE@euro"
LINGUAS="de en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apm arts audiofile avi berkdb bitmap-fonts bzip2 cdr crypt cups
curl dri dvd eds encode ethereal exif expat fam ffmpeg foomaticdb fortran gdbm
gif gpm gstreamer idn imagemagick imlib ipv6 isdnlog java jpeg kde lcms libg++
libwww mad mikmod mng motif mp3 mpeg ncurses nls ogg oggvorbis opengl pam pcre
pdflib perl png pppd python qt quicktime readline recode scanner sdl slang
spell ssl tcltk tcpd tiff truetype truetype-fonts type1-fonts udev usb vorbis
xine xml2 xmms xv zlib linguas_de linguas_en userland_GNU kernel_linux
elibc_glibc"
Unset:  ASFLAGS, CTARGET, LDFLAGS, PORTDIR_OVERLAY

------- Comment #1 From Jakub Moc (RETIRED) 2006-04-01 10:02:37 0000 -------
Reopen with ebuild name and version...

------- Comment #2 From Thomas Lenz 2006-04-02 03:27:55 0000 -------
ebuild name and version is:
mjpegtools-1.8.0-r1

------- Comment #3 From Robert Piro 2006-05-01 02:14:02 0000 -------
Does lavrec somehow involve lav2wav? 
Have a look at 
http://article.gmane.org/gmane.comp.video.mjpeg.user/9226/match=mjpegtools+1+8+memory

I think we have to wait until 1.8.3 or use the CVS version.

------- Comment #4 From Robert Piro 2006-05-01 02:17:21 0000 -------
Sorry, I meant 1.8.0.-r3 (not 1.8.3)

------- Comment #5 From Klaus Stengel 2006-05-13 20:02:16 0000 -------
Have a look at #100869

That broken patch made it somehow into 1.8.0 upstream; I'm currently working on
an updated patch.

------- Comment #6 From Klaus Stengel 2006-05-13 21:45:17 0000 -------
Created an attachment (id=86726) [details]
possible fix

This patch should fix it, but tested on x86 only.

I'm not sure if there are any issues with different
endian machines (like PPC) left. In case it's broken you get
only "noise" in the audio track...

------- Comment #7 From Jakub Moc (RETIRED) 2006-05-29 02:56:46 0000 -------
*** Bug 134740 has been marked as a duplicate of this bug. ***

------- Comment #8 From Matthias Schwarzott 2006-11-19 09:23:41 0000 -------
Patch added to mjpegtools-1.8.0-r2.

------- Comment #9 From Matthias Schwarzott 2007-02-25 22:21:07 0000 -------
I have a report that this bug is still existing.

------- Comment #10 From Matthias Schwarzott 2007-02-26 12:42:05 0000 -------
Can someone please test mjepgtools-1.9.0_rc1, and tell me if that patch (that
still gets applied) need to be removed.

------- Comment #11 From Matthias Schwarzott 2007-02-27 15:36:22 0000 -------
This patch seems to be correct, and it was not included in 1.9.0_rc1
(upstream).
It has now been pushed there.