Capítulo 447 de 988

Chapter 447: How much does Remotion Lambda cost?

Core Idea

This page shows estimations to help you better expect how much Remotion Lambda will cost.

Key Concepts

  • Rendering the Hello World project
  • Rendering a 1 minute Video in the same S3 bucket
  • Rendering a 10 minute Remote HD Video
  • Rendering a 10 second Remote 4K Video
  • Additional cost
  • See also

Code Examples

// @filename: get-media-metadata.ts

export const getMediaMetadata = async (src: string) => {
  const input = new Input({
    formats: ALL_FORMATS,
    source: new UrlSource(src, {
      getRetryDelay: () => null,
    }),
  });

  const durationInSeconds = await input.computeDuration();
  const videoTrack = await input.getPrimaryVideoTrack();
  const dimensions = videoTrack
    ? {
        width: videoTrack.displayWidth,
        height: videoTrack.displayHeight,
      }
    : null;
  const frameRateMetrics = videoTrack
    ? await videoTrack.computeFrameRateMetrics()
    : null;
  const fps =
    frameRateMetrics === null || frameRateMetrics.probedPacketCount < 2
      ? null
      : frameRateMetrics.bestGuessFrameRate;

  return {
    durationInSeconds,
    dimensions,
    fps,
  };
};

// @filename: index.tsx
// https://www.remotion.dev/docs/mediabunny/metadata

const src = staticFile('bigbuckbunny.mp4');

export const calculateMetadataFn: CalculateMetadataFunction<Record<string, unknown>> = async () => {
  const {durationInSeconds, dimensions, fps} = await getMediaMetadata(src);
  const compositionFps = fps ?? 30;

  return {
    durationInFrames: Math.round(durationInSeconds * compositionFps), // 1440
    fps: compositionFps,
    width: dimensions!.width,
    height: dimensions!.height,
  };
};

export const Component = () => {
  return <Video src={src} />;
};

export const
// ...(truncated)
  • What it demonstrates: Usage pattern for How much does Remotion Lambda cost? from the official docs.

Key Takeaways

  1. Understand rendering the hello world project when working with How much does Remotion Lambda cost?.
  2. Understand rendering a 1 minute video in the same s3 bucket when working with How much does Remotion Lambda cost?.
  3. Understand rendering a 10 minute remote hd video when working with How much does Remotion Lambda cost?.
  4. Understand rendering a 10 second remote 4k video when working with How much does Remotion Lambda cost?.
  5. Understand additional cost when working with How much does Remotion Lambda cost?.

Connects To

  • api: related page in the Lambda (@remotion/lambda) section.
  • Approuterwebhook: related page in the Lambda (@remotion/lambda) section.
  • Authentication: related page in the Lambda (@remotion/lambda) section.