I'm facing a OOM error on Lambda. Currently only at a 3008MB limit but I'm spawning the maximum recommended lambdas (200) but it seems to not be helping. Video is about 20 minutes long. Since I'm only doing the 1 concurrency frame per lambda as per default, what is causing the issue? I attached some logs from Cloud Watch
#Out of Memory Error on Lambda
16 messages · Page 1 of 1 (latest)
Context:
Video is 20 minutes long, 1 audio track, about 120 clips + different compositions and effects.
Remotion version: 4.0.438
I tried using all kinds of video tags - remotion/media Video, normal Video, OffthreadVideo, etc.
Not sure why there's such high memory consumption
are you mixing video tags?
seems like offthreadvideo and remotion/media are both present and both wanna take 50% RAM.
that could be a reason. ai analysis:
This is the primary killer. Two independent caching systems both claim ~50% of total memory:
Rust compositor video cache: 1340 MB (log 1) / 1246 MB (log 2)
@remotion/media browser-side cache: 1479 MB (log 1) / 1443 MB (log 2)
i'll have to analyze, i also had AI replace all video tags and vice-versa while testing so it may have missed out some of it
in this case, you would just recommend using @remotion/media's video tag?
yes
anything else will cause compositor to use video cache?
no, only the other way around - if a @remotion/media video gets a file that cannot be encoded, it will fall back to "rust compositor"/OffthreadVideo
yeah i may get some files that are like prores, etc. since i grab them from stock footage sites and the codecs aren't uniform
you can tweak it using https://www.remotion.dev/docs/lambda/rendermediaonlambda#offthreadvideocachesizeinbytes and https://www.remotion.dev/docs/lambda/rendermediaonlambda#mediacachesizeinbytes
i understand the minimum media cache is 500mb right?
if i set offthreadvideo's cache to be 500mb, it should be safe in some instances where it fallbacks
even setting a 512 mb cache for offthreadvideo causes OOM error
seems like my video was having some issue and it kept spawning keybanks
which resulted in an OOM error
that's not good.
sorry for the late response, if you provide the video under https://remotion.dev/report, I will take a look and try to reproduce and optimize!