Skip to content

Commit

Permalink
Merge pull request #1355 from uragirii/main
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBurger committed Oct 4, 2022
2 parents 5460153 + db469f7 commit 027c502
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
13 changes: 7 additions & 6 deletions packages/docs/docs/lambda/rendermediaonlambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,9 @@ const { bucketName, renderId } = await renderMediaOnLambda({
region: "us-east-1",
functionName: "remotion-render-bds9aab",
composition: "MyVideo",
framesPerLambda: 20,
serveUrl:
"https://remotionlambda-qg35eyp1s1.s3.eu-central-1.amazonaws.com/sites/bf2jrbfkw",
inputProps: {},
codec: "h264",
imageFormat: "jpeg",
maxRetries: 1,
privacy: "public",
});
```

Expand All @@ -40,6 +35,8 @@ In which region your Lambda function is deployed. It's highly recommended that y

### `privacy`

_optional since v3.2.26_

One of:

- `"public"` (_default_): The rendered media is publicly accessible under the S3 URL.
Expand Down Expand Up @@ -74,6 +71,8 @@ The `id` of the [composition](/docs/composition) you want to render.

### `inputProps`

_optional since v3.2.26_

React props that are passed to your composition. You define the shape of the props that the component accepts.

### `codec`
Expand All @@ -92,6 +91,8 @@ Disables audio output. See also [`renderMedia() -> muted`](/docs/renderer/render

### `imageFormat`

_optional since v3.2.26_

See [`renderMedia() -> imageFormat`](/docs/renderer/render-media#imageformat).

### `crf`
Expand All @@ -116,7 +117,7 @@ See [`renderMedia() -> quality`](/docs/renderer/render-media#quality).

### `maxRetries`

_optional, default `1`_
_optional since v3.2.26, default `1`_

How often a chunk may be retried to render in case the render fails.
If a rendering of a chunk is failed, the error will be reported in the [`getRenderProgress()`](/docs/lambda/getrenderprogress) object and retried up to as many times as you specify using this option.
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/renderer/render-media.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The constant rate factor, controlling the quality. See: [Controlling quality usi

### `imageFormat?`

_"jpeg" (default) | "png" | "none" - optional_
_"jpeg" (default) | "png" | "none" - optional since v3.2.26_

In which image format the frames should be rendered.

Expand Down
20 changes: 10 additions & 10 deletions packages/lambda/src/api/render-media-on-lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ export type RenderMediaOnLambdaInput = {
functionName: string;
serveUrl: string;
composition: string;
inputProps: unknown;
inputProps?: unknown;
codec: LambdaCodec;
imageFormat: ImageFormat;
imageFormat?: ImageFormat;
crf?: number | undefined;
envVariables?: Record<string, string>;
pixelFormat?: PixelFormat;
proResProfile?: ProResProfile;
privacy: Privacy;
privacy?: Privacy;
quality?: number;
maxRetries: number;
maxRetries?: number;
framesPerLambda?: number;
logLevel?: LogLevel;
frameRange?: FrameRange;
Expand Down Expand Up @@ -64,13 +64,13 @@ export type RenderMediaOnLambdaOutput = {
* @param params.composition The ID of the composition which should be rendered.
* @param params.inputProps The input props that should be passed to the composition.
* @param params.codec The media codec which should be used for encoding.
* @param params.imageFormat In which image format the frames should be rendered.
* @param params.imageFormat In which image format the frames should be rendered. Default "jpeg"
* @param params.crf The constant rate factor to be used during encoding.
* @param params.envVariables Object containing environment variables to be inserted into the video environment
* @param params.proResProfile The ProRes profile if rendering a ProRes video
* @param params.quality JPEG quality if JPEG was selected as the image format.
* @param params.region The AWS region in which the media should be rendered.
* @param params.maxRetries How often rendering a chunk may fail before the media render gets aborted.
* @param params.maxRetries How often rendering a chunk may fail before the media render gets aborted. Default "1"
* @param params.logLevel Level of logging that Lambda function should perform. Default "info".
* @returns {Promise<RenderMediaOnLambdaOutput>} See documentation for detailed structure
*/
Expand Down Expand Up @@ -120,16 +120,16 @@ export const renderMediaOnLambda = async ({
framesPerLambda: framesPerLambda ?? null,
composition,
serveUrl: realServeUrl,
inputProps,
inputProps: inputProps ?? {},
codec: actualCodec,
imageFormat,
imageFormat: imageFormat ?? 'jpeg',
crf,
envVariables,
pixelFormat,
proResProfile,
quality,
maxRetries,
privacy,
maxRetries: maxRetries ?? 1,
privacy: privacy ?? 'public',
logLevel: logLevel ?? 'info',
frameRange: frameRange ?? null,
outName: outName ?? null,
Expand Down

1 comment on commit 027c502

@vercel
Copy link

@vercel vercel bot commented on 027c502 Oct 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.