New submission from Martin Sperl <[email protected]>:

I am trying to convert ts files from my DVB-S box to feed it to iMovie.
One of the files that I want to process is triggering a bug in ffmpeg, so that
it is eating memory - 8 GB and more after some time.

Surprisingly I found an old precompiled version of ffmpeg, that is still
accepting the file without issues...

Here the Conversion output including some ps traces and timestamps:

msmac:ffmpeg sperl$ date;./ffmpeg -v 9 -loglevel 99 -i
/Volumes/Photo/noTimeMachine/KoenigOedipus.0.ts -target dv /tmp/t.dv -indexmem 
100
Mo 27 Dez 2010 01:36:21 CET
FFmpeg version SVN-r26099, Copyright (c) 2000-2010 the FFmpeg developers
  built on Dec 27 2010 00:52:44 with gcc 4.2.1 (Apple Inc. build 5664)
  configuration: 
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 0 /  0.16. 0
  libavcodec    52.100. 0 / 52.100. 0
  libavformat   52.89. 0 / 52.89. 0
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.70. 2 /  1.70. 2
  libswscale     0.12. 0 /  0.12. 0
[NULL @ 0x10100b000] Probed with size=2048 and score=100
[mpegts @ 0x10100b000] stream=0 stream_type=2 pid=456 prog_reg_desc=
[mpegts @ 0x10100b000] stream=1 stream_type=3 pid=460 prog_reg_desc=
[mpegts @ 0x10100b000] stream=2 stream_type=3 pid=461 prog_reg_desc=
[mpegts @ 0x10100b000] stream=3 stream_type=6 pid=276 prog_reg_desc=
[mpeg2video @ 0x101039600] mpeg_decode_postinit() failure
    Last message repeated 10 times
[mpegts @ 0x10100b000] max_analyze_duration reached
Input #0, mpegts, from '/Volumes/Photo/noTimeMachine/KoenigOedipus.0.ts':
  Duration: 17:18:52.24, start: 33396.960489, bitrate: 138 kb/s
  Program 28006 
  Program 28011 
  Program 28014 
  Program 28016 
    Stream #0.0[0x456], 130, 1/90000: Video: mpeg2video, yuv420p, 720x576 [PAR
64:45 DAR 16:9], 1/50, 15000 kb/s, 26.89 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x460](deu), 211, 1/90000: Audio: mp2, 48000 Hz, 2 channels,
s16, 256 kb/s
    Stream #0.2[0x461](mis), 210, 1/90000: Audio: mp2, 48000 Hz, 2 channels,
s16, 128 kb/s
    Stream #0.3[0x276](deu), 130, 1/90000: Subtitle: [6][0][0][0] / 0x0006
  Program 28007 
  Program 28008 
  Program 28017 
  Program 28012 
  Program 28013 
Assuming PAL for target.
[buffer @ 0x100c078b0] w:720 h:576 pixfmt:yuv420p
Output #0, dv, to '/tmp/t.dv':
  Metadata:
    encoder         : Lavf52.89.0
    Stream #0.0, 0, 1/90000: Video: dvvideo, yuv420p, 720x576 [PAR 64:45 DAR
16:9], 1/25, q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0.1(deu), 0, 1/90000: Audio: pcm_s16le, 48000 Hz, 2 channels, s16,
1536 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
[mpeg2video @ 0x101039600] warning: first frame is no keyframe
*** 1517397 dup!

CTRL-Z

[1]+  Stopped                 ./ffmpeg -v 9 -loglevel 99 -i
/Volumes/Photo/noTimeMachine/KoenigOedipus.0.ts -target dv /tmp/t.dv -indexmem 
100
msmac:ffmpeg sperl$ date;ps uaxwww | grep ffmpeg |grep -v grepMo 27 Dez 2010
01:36:31 CET
sperl    60988   0,0  3,1  2721068 259520 s000  T     1:36am   0:05.20 ./ffmpeg
-v 9 -loglevel 99 -i /Volumes/Photo/noTimeMachine/KoenigOedipus.0.ts -target dv
/tmp/t.dv -indexmem 100
msmac:ffmpeg sperl$ fg
./ffmpeg -v 9 -loglevel 99 -i /Volumes/Photo/noTimeMachine/KoenigOedipus.0.ts
-target dv /tmp/t.dv -indexmem 100

CTRL-Z

[1]+  Stopped                 ./ffmpeg -v 9 -loglevel 99 -i
/Volumes/Photo/noTimeMachine/KoenigOedipus.0.ts -target dv /tmp/t.dv -indexmem 
100
msmac:ffmpeg sperl$ date;ps uaxwww | grep ffmpeg |grep -v grep
Mo 27 Dez 2010 01:36:47 CET
sperl    60988   0,0  8,3  3161820 700352 s000  T     1:36am   0:14.47 ./ffmpeg
-v 9 -loglevel 99 -i /Volumes/Photo/noTimeMachine/KoenigOedipus.0.ts -target dv
/tmp/t.dv -indexmem 100
msmac:ffmpeg sperl$

You see that over the range of 15s the process was eating about 500MB and the
output file remains empty. If I do not kill the process it will run filling swap
until it runs out of disk-space...

Thanks,
        Martin

P.s: I had seen a similar bug already, where the recommendation was to use
-indexmem. Changing the argument from 100 to 100000 does not change much -
memory consumption is only growing at a slower rate...

----------
messages: 13057
priority: normal
status: new
substatus: new
title: ffmpeg is eating lots of memory on OSX for some conversions of ts streams
type: bug

________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/issue2450>
________________________________________________

Reply via email to