[FFmpeg-devel] libavcodec memory usage

Matthieu Beghin matthieu.beghin at garagecube.com
Tue Jan 3 18:44:09 EET 2017


> I'm assuming that you're talking about 8K H264 with pixfmt=yuv420p10? 8K yuv420p10 frames are 100MB

Correct

> 32 plus delayed output and current_pic gives H264_MAX_PICTURE_COUNT = 36 without threading: 36*100=3.6GB.

What do you mean by "delayed output” ? Can you link me to a document ?

> Or maybe consider ditching 32bit support?

Unfortunately, that’s 10 years old app using OSX Carbon library (not 64 bits), and rewriting that part would be too much work.

As an alternative, is there a way to know how much bytes are buffered ? Iterating buffered frames ?

Thanks!


> On 03 Jan 2017, at 17:09, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> 
> Hi,
> 
> On Tue, Jan 3, 2017 at 10:58 AM, Matthieu Beghin <
> matthieu.beghin at garagecube.com> wrote:
> 
>> Hi,
>> 
>> My application is using libavcodec etc. to playback movies. Everything is
>> ok with our 64 bits app. But I have a 32 bits app and there when playing a
>> 8k we reach 3 GB memory usage, so when adding another 4k or a few HD
>> movies, the app crashes.
>> 
>> I haven’t found a way to reduce memory usage. The library stores lots of
>> frames or data. I tried reducing thread_count to 1 to test, but it does not
>> help and performances are not acceptable.
>> 
>> Is there a way to limit the size of buffered data / number of buffered
>> frames ?
>> I’m using FFMPEG 2.8.7 (libavcodec.56.60.100 / libavformat.56.40.101).
> 
> 
> I'm assuming that you're talking about 8K H264 with pixfmt=yuv420p10? 8K
> yuv420p10 frames are 100MB, H264 can have up to 16 refs/field, for
> interlaced content this means 32 plus delayed output and current_pic gives
> H264_MAX_PICTURE_COUNT = 36 without threading: 36*100=3.6GB.
> 
> There's not much you can do about this in the decoder side. You can tell
> your encoder to use less references and discard references earlier. How to
> do this depends on which encoder you're using.
> 
> Or maybe consider ditching 32bit support?
> 
> Ronald
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list