#Can't render with lambda 😢

14 messages · Page 1 of 1 (latest)

rose solar
#

Hi team! I'm desperately trying to render my video with lambda.

The context:

  1. It works locally. Renders kinda fast, under a couple of minutes.
  2. I'm on Remotion 4.0.177
  3. I'm using videoTexture (a video is placed inside a 3D model):
    Gist: https://gist.github.com/alexanderisora/9db12f99072c4f29f0046ee584dbe697
  4. These are my rendering settings:
    const result = await renderMediaOnLambda({
      codec: "h264",
      functionName: speculateFunctionName({
        diskSizeInMb: DISK,
        memorySizeInMb: RAM,
        timeoutInSeconds: TIMEOUT,
      }),
      timeoutInMilliseconds: 1500 * 1000, // limited by the lambda's timeout too: https://eu-north-1.console.aws.amazon.com/lambda/home?region=eu-north-1#/functions/remotion-render-4-0-177-mem2048mb-disk2048mb-120sec?tab=configure
      // timeoutInSeconds: 900,
      concurrencyPerLambda: 2,
      region: REGION as AwsRegion,
      serveUrl: LAMBDA_URL,
      composition: body.id,
      inputProps: body.inputProps,
      framesPerLambda: 20,
      logLevel: "verbose",
      chromiumOptions: {
        //   gl: "angle",
      },
      downloadBehavior: {
        type: "download",
        fileName: "video.mp4",
      },
    });
#

Every time I hit "render" I get this error:

"Error: The main function timed out after 599999ms. The following chunks are missing (showing 5 out of 25): Chunk 0 ... 5 Consider increasing the timeout of your function. â–¸ You can use the "--timeout" parameter when deploying a function via CLI, or the "timeoutInSeconds" parameter when using the deployFunction() API. https://remotion.dev/docs/lambda/cli/functions#deploy â–¸ Visit the logs for the main function: â–¸ Visit the logs for the renderer functions:â–¸ Get help on debugging this error: https://remotion.dev/docs/lambda/troubleshooting/debug
"

No matter if my timeout is the default 2min or 10 min, the error is the same.

Logs: https://gist.github.com/alexanderisora/1e5786a22512319aeb35f0d0e4e82895

#

Locally I use gl: "angle", but it fails to be set on lambda. So I'm forced to use swangle
Can it be the reason?

#

I've also tried to comment out the videoTexture part and it worked smoothly.
My video also contains images which are server from the same URL and the same provider (Cloudflare R2) and they were loaded nice and rendered nice, no timeouts.

#

I've also tried to simplify my videoTexture component as much as possible:

  1. moved 3D model and videoTexture leaving just <Video>
  2. using tiny video file (800KB).

It got stuck and timed out too!

#

So the problem is: <Video> component is timeout everytime no matter what the filesize is.

rose solar
#

I tried to render it with the video file uploaded to an S3 bucket in the same region.
Got the same problem (time-outed).

    <Video
        src={
          "https://paracast-render.s3.eu-north-1.amazonaws.com/SaasTeaser.webm"
        }
      />
rose solar
#

Here is what I came up with:

  1. rendering 3D model on lambda is a bad idea (since lambda is CPU-only)
  2. rendering a video inside a 3D model on lambda is a x2 bad idea (since we can not use OffthreadVideo because i need to use ref to apply the video as a texture of the 3D model)
  3. I need to get ready to spend $375/m on a GPU unit. Or forget using Video-in-3D.
spice pier
rose solar
# spice pier you sure that lambda can't handle that ? it's usually beefy enough for everythi...

yes. lambda rendered my 3d model with VideoTexture removed. but it takes it ~7 minutes to render a 30sec video. if i remove the 3d model part it takes 20sec to render.
i compressed the model textures (x3 times) but the rendering time is still the same.

taking the fact that the max labmda timeout is 10min, 7 minutes is so close to the limit.
so it looks like lambda is just not the right tool for rendering 3D, is not it?

#

am I doing something wrong? or lambda is just not the right tool for 3D objects?

spice pier
rose solar
spice pier