Kagami / webm.js

JavaScript WebM converter

Home Page:https://kagami.github.io/webm.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minimize memory consumption

Kagami opened this issue · comments

Things currently broken:

  • Subtitles rendering, process hungs
  • Encoding the entire file, audio/last video processes hungs

Things still causing out of memory:

  • ~400M fails at info stage
  • ~200M fails while encoding

What can be done?

  • Small -max_alloc helps at info stage
  • -blocksize ?
  • Some advanced ffmpeg options/try to patch?
  • Compile with ALLOW_MEMORY_GROWTH, bench results?

TOTAL_MEMORY=256M for encoder and 128M for prober allows to successfully encode 600M+ files. MEMFS works with that values too but consumes much more memory.

ALLOW_MEMORY_GROWTH works as well and doesn't cause significant slowdown in nightly, though it may cause problems in v8 so let's keep it disabled for now.

It still may be worth to try advanced ffmpeg options and bigger files/different TOTAL_MEMORY values in order to decrease memory consumption even more.

Any updates on this?

Switching build to WebAssembly should allow natural memory growth without the performance penalty from asm.js's growth mode...

Thanks, @brion, worth a try.