Menu

Out of memory.

Help
retroben
2014-10-23
2022-01-22
  • retroben

    retroben - 2014-10-23

    I have 320 frames in 1920x1080 at 60fps in 5 seconds and the size total is 494MB which is smaller than my 8 second animation of 517 frames in 640x480 at 60fps-esque speeds of 517MB total size.
    The resulting png animation ended up being 1.09MB total for 8 seconds of footage!

    After dragging the 320 frames to the GUI program,I started the making procedure.

    I began the making procedure and waited for a while until I checked the process in task manager,only to find it was taking 1.55GB of RAM.
    Then it said out of memory and stopped dead before even showing any progress,so I am stuck with no choice of making it because it will just run out of memory again.

    Will you please make your program use temporary storage space for making animated PNGs so it no longer runs out of memory?

    If you do,everyone would be able to make 1080P HD quality png animations,and maybe even 4K resolution ones.
    Please fix this major issue,as I need to make this animation for power testing a beta apng viewing app for android.

     
  • Max Stepin

    Max Stepin - 2014-10-24

    APNG is not an ideal format for (320 frames in 1920x1080) kind of stuff.

    Both encoder and decoder would need access to full uncompressed set of frames,
    and that's 1920 * 1080 * 320 * 4 = well above 2Gb.

    320 frames is a LOT.

    Where your viewing app is going to store >2Gb of uncompressed frames?
    Android devices rarely have >2Gb RAM to give to a single app.

     
  • retroben

    retroben - 2014-10-27

    Okay,it really sucks that I can't make it as it is.

    Do you know of a tool that can somewhat compress the actual images so the "uncompressed" size shrinks considerably but without much noticable difference in quality?

     
  • Anonymous

    Anonymous - 2016-02-19

    Well, 1.5..2 GB is about the limit for a 32 bit application.
    For more, a 64 bit version of APNG Assembler is required.

    BTW, for a high quality apng, 320 frames are not so many.
    I have several 768x768 480 frames 10 sec 48 fps apngs. On my CPU (2.1 GHz 4 cores) it takes 10..30 min to assemble/compress the frames.
    The viewing app (IrfanView) takes 244 MB RAM when viewing and 4 MB when not. So it uses 240 MB buffer to decompress, not 1 GB. And it's fast...

     
  • Anonymous

    Anonymous - 2016-02-29

    Well, I had the curiosity to recompile the Windows sources for x64.

    https://drive.google.com/file/d/0ByKxAD_t9uvLVjdfZmY4MmRKX0E/view?usp=sharing

    And I tried with 1440 frames (314.31 KB each compressed) of 768x768 = 3.164 GB (!).
    The progressbar stays at the end over 90% of the time (few hours). It seems the high number of frames may be the cause. I looked in the source code and I dont't understand (yet) why it is using this instead of a linear progression:

    for (i=first; i<frames-1; i++)
    ...
    SendDlgItemMessage(hMainDlg, IDC_PROGRESS1, PBM_SETPOS, frames+46i, 0);
    _snwprintf(szBuf, 8, L"%d %%\0", (frames+46
    i)100/(48frames));
    SetDlgItemText(hMainDlg, IDC_PERCENT, szBuf);

    But it does the job: a 425 MB apng taking 2.4 GB RAM with IrfanView https://drive.google.com/file/d/0ByKxAD_t9uvLdU1Sbmg5OGFjM0E/view?usp=sharing

    I know it's unusable for internet but it was fun :)

    Max Stepin, could you please solve the problem with the progressbar and the percentage at high number of frames + add the 64 bit version to the download?

    Thank you.

     
  • Max Stepin

    Max Stepin - 2016-02-29

    Thanks, I'll take a look into it ASAP.

     
  • c_cosmin

    c_cosmin - 2017-02-01

    Thank you for fixing the problem and for adding the 64 bit binaries for Windows.

     

    Last edit: c_cosmin 2017-02-01
  • Shawn Givler

    Shawn Givler - 2018-01-04

    Max, I understand you didn't intend to develop apngasm for large data sets; however, I find it very useful for making animations of my scientific data. It provides decent compression while maintaining high image quality. While using the Linux version to make animations of up to 400 1130x950 images without a problem. Somewhere after this, (i.e. 500 or more images) I get an error message:

    terminate called after throwing an instance of 'std::bad_alloc'
    what(): std::bad_alloc

    I'm using an 8-core i7 machine running CentOS release 6.9 with 164GB ram.

    It would sure be great if apngasm could work for larger data sets!

     
  • Max Stepin

    Max Stepin - 2018-01-05

    If you can compile a 64-bit version for Linux, it should work with large data sets.

     
  • Kenneth

    Kenneth - 2022-01-22

    Thank you for excellent application! It works very fine with a lot of files.
    But I tried compiling VERY LARGE set of frames with Win32 version (both CLI & GUI):
    == Command Line ==
    d:...> apngasm out.png 00001.png
    ... ...
    loading 09010.png (9010 of 29640)
    == Popup Message==
    (X) unknown software exception 0x40000015 at 0x00431000

    Source PNG are about 256x256, 28KB size. I understand that is a Win32 limit but:
    1) total size of loaded files is significally less available memory;
    2) I expected to see a warning and stop, not an exception.
    (and application doesn't use all available memory on crash time, according Task Manager at least)

     

    Last edit: Kenneth 2022-01-22

Log in to post a comment.