[FFmpeg-user] out of memory when using "copy"

Soho Soho123 soho123.2012 at gmail.com
Tue Feb 5 03:15:53 CET 2013


Hi All,
I add a Stream in my ffserver config as below:
<Stream test.mjpg>
Feed feed1.ffm
Format mjpeg

VideoFrameRate 30
VideoSize 1280x720
VideoBitRate 256
VideoBufferSize 400
#VideoGopSize 3
VideoIntraOnly
#NoAudio
#Strict -1
</Stream>

The out of memory was happened. Does someone have idea?
the log that I capture below:

[quote]# ffserver -d -f /etc/ffserver.conf&
ffserver version 1.1.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb  4 2013 17:53:25 with gcc 4.4.5-1.5.5p4 (GCC)
  configuration: --enable-cross-compile --cross-prefix=rsdk-linux-
--arch=mips --target-os=linux --disable
-w32threads --disable-os2threads --disable-ffplay --disable-postproc
--disable-mips32r2 --disable-yasm --d
isable-vis --disable-altivec --disable-mipsdspr1 --disable-mipsdspr2
--disable-mipsfpu --enable-small --pr
efix=/ffmpeg-1.1.1/romfs --bindir=/ffmpeg-1.1.1/romfs --enable-pic --disable
-encoders --enable-encoder=mjpeg --enable-encoder=flv
--enable-encoder=mpeg4 --disable-decoders --enable-d
ecoder=mjpeg --enable-decoder=flv --enable-decoder=mpeg4
--enable-decoder=rawvideo --enable-encoder=rawvid
eo --enable-decoder=vorbis --enable-encoder=vorbis --disable-hwaccels
--disable-muxers --disable-demuxers
--enable-muxer=rawvideo --enable-muxer=mpegts --enable-muxer=ffm
--enable-muxer=mov --enable-muxer=yuv4mpe
gpipe --enable-muxer=rtp --enable-muxer=flv --enable-muxer=rtsp --ena
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 86.100 / 54. 86.100
  libavformat    54. 59.106 / 54. 59.106
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 32.100 /  3. 32.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
# Tue Feb  5 07:26:07 2013 FFserver started.

# ffmpeg -f video4linux2 -r 30 -s 1280x720 -i /dev/video0 -c copy -f mpegts http
://localhost:8090/feed1.ffm
ffmpeg version 1.1.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb  4 2013 17:53:25 with gcc 4.4.5-1.5.5p4 (GCC)
  configuration: --enable-cross-compile --cross-prefix=rsdk-linux-
--arch=mips --target-os=linux --disable
-w32threads --disable-os2threads --disable-ffplay --disable-postproc
--disable-mips32r2 --disable-yasm --d
isable-vis --disable-altivec --disable-mipsdspr1 --disable-mipsdspr2
--disable-mipsfpu --enable-small --pr
efix=/ffmpeg-1.1.1/romfs --bindir=/ffmpeg-1.1.1/romfs --enable-pic --disable
-encoders --enable-encoder=mjpeg --enable-encoder=flv
--enable-encoder=mpeg4 --disable-decoders --enable-d
ecoder=mjpeg --enable-decoder=flv --enable-decoder=mpeg4
--enable-decoder=rawvideo --enable-encoder=rawvid
eo --enable-decoder=vorbis --enable-encoder=vorbis --disable-hwaccels
--disable-muxers --disable-demuxers
--enable-muxer=rawvideo --enable-muxer=mpegts --enable-muxer=ffm
--enable-muxer=mov --enable-muxer=yuv4mpe
gpipe --enable-muxer=rtp --enable-muxer=flv --enable-muxer=rtsp --ena
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 86.100 / 54. 86.100
  libavformat    54. 59.106 / 54. 59.106
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 32.100 /  3. 32.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
[video4linux2,v4l2 @ 0x7d61c0] The driver changed the time per frame
from 1/30 to 1/10
ffmpeg invoked oom-killer: gfp_mask=0xd0, order=0, oomkilladj=0
uptime: 45031.34 44842.42
Call Trace:[<80015960>] 0x80015960
[<80005fb8>] 0x80005fb8
[<80005fb8>] 0x80005fb8
[<8003c864>] 0x8003c864
[<8002d9c8>] 0x8002d9c8
[<8003cb90>] 0x8003cb90
[<8001e93c>] 0x8001e93c
[<8003cc3c>] 0x8003cc3c
[<8003fd08>] 0x8003fd08
[<80054ee8>] 0x80054ee8
[<80054fdc>] 0x80054fdc
[<801f182c>] 0x801f182c
[<801f182c>] 0x801f182c
[<80055108>] 0x80055108
[<801f182c>] 0x801f182c
[<801f182c>] 0x801f182c
[<80036d28>] 0x80036d28
[<801f2fc0>] 0x801f2fc0
[<80000420>] 0x80000420
[<8004a7c4>] 0x8004a7c4
[<801e6524>] 0x801e6524
[<8005d71c>] 0x8005d71c
[<8004bbe4>] 0x8004bbe4
[<800f5960>] 0x800f5960
[<800f5d8c>] 0x800f5d8c
[<800fdde4>] 0x800fdde4
[<80067d48>] 0x80067d48
[<800faf04>] 0x800faf04
[<800f422c>] 0x800f422c
[<8003505c>] 0x8003505c
[<80067df4>] 0x80067df4
[<8005880c>] 0x8005880c
[<800086f4>] 0x800086f4
[<80001330>] 0x80001330

Mem-Info:
Normal per-cpu:
CPU    0: hi:   18, btch:   3 usd:  16
Active_anon:160 active_file:3 inactive_anon:147
 inactive_file:0 unevictable:312 dirty:0 writeback:0 unstable:0
 free:142 slab:2068 mapped:0 pagetables:36 bounce:0
Normal free:568kB min:1024kB low:512kB high:580kB active_anon:640kB
inactive_anon:588kB active_file:12kB i
nactive_file:0kB unevictable:1248kB present:65024kB pages_scanned:1779
all_unreclaimable? no
lowmem_reserve[]: 0 0
Normal: 8*4kB 5*8kB 1*16kB 1*32kB 1*64kB 1*128kB 1*256kB 0*512kB
0*1024kB 0*2048kB 0*4096kB = 568kB
315 total pagecache pages
16384 pages RAM
2308 pages reserved
3 pages shared
13087 pages non-shared
Out of memory: kill process 992 (ffmpeg) score 73 or a child
Killed process 992 (ffmpeg)
ffmpeg: page allocation failure. order:0, mode:0xd0
uptime: 45031.74 44842.42
Call Trace:[<80015960>] 0x80015960
[<80005fb8>] 0x80005fb8
[<80005fb8>] 0x80005fb8
[<8003fdb0>] 0x8003fdb0
[<80054ee8>] 0x80054ee8
[<80054fdc>] 0x80054fdc
[<801f182c>] 0x801f182c
[<801f182c>] 0x801f182c
[<80055108>] 0x80055108
[<801f182c>] 0x801f182c
[<801f182c>] 0x801f182c
[<80036d28>] 0x80036d28
[<801f2fc0>] 0x801f2fc0
[<80000420>] 0x80000420
[<8004a7c4>] 0x8004a7c4
[<801e6524>] 0x801e6524
[<8005d71c>] 0x8005d71c
[<8004bbe4>] 0x8004bbe4
[<800f5960>] 0x800f5960
[<800f5d8c>] 0x800f5d8c
[<800fdde4>] 0x800fdde4
[<80067d48>] 0x80067d48
[<800faf04>] 0x800faf04
[<800f422c>] 0x800f422c
[<8003505c>] 0x8003505c
[<80067df4>] 0x80067df4
[<8005880c>] 0x8005880c
[<800086f4>] 0x800086f4
[<80001330>] 0x80001330

Mem-Info:
Normal per-cpu:
CPU    0: hi:   18, btch:   3 usd:   0
Active_anon:160 active_file:3 inactive_anon:147
 inactive_file:0 unevictable:312 dirty:0 writeback:0 unstable:0
 free:0 slab:2068 mapped:0 pagetables:36 bounce:0
Normal free:0kB min:1024kB low:512kB high:580kB active_anon:640kB
inactive_anon:588kB active_file:12kB ina
ctive_file:0kB unevictable:1248kB present:65024kB pages_scanned:1779
all_unreclaimable? no
lowmem_reserve[]: 0 0
Normal: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB
0*1024kB 0*2048kB 0*4096kB = 0kB
315 total pagecache pages
16384 pages RAM
2308 pages reserved
3 pages shared
13245 pages non-shared
ffmpeg: page allocation failure. order:0, mode:0xd0[/quote]



Does someone have idae about why ffmpeg occpuy memory when ffmpeg get
frame, but not release memory if no any client connected?


More information about the ffmpeg-user mailing list