Skip to content

🎥 Make videos programmatically with React

return output size in bytes

Jonny Burger9decb296047b
diff --git a/packages/docs/docs/lambda/getrenderprogress.md b/packages/docs/docs/lambda/getrenderprogress.md
index 03a2543350..cd05ebb441 100644
--- a/packages/docs/docs/lambda/getrenderprogress.md
+++ b/packages/docs/docs/lambda/getrenderprogress.md
@@ -123,6 +123,12 @@ The current time at which the Lambda function responded to the progress request.
How many bytes have been saved to the S3 bucket as a result of this render.
+### `outputSizeInBytes`
+
+_available from v.3.3.9_
+
+The size of the output artifact in bytes.
+
### `lambdasInvoked`
How many lambdas that render a chunk have been invoked yet and have started rendering.
diff --git a/packages/lambda/src/functions/helpers/get-progress.ts b/packages/lambda/src/functions/helpers/get-progress.ts
index a5c539a0aa..2404ca344f 100644
--- a/packages/lambda/src/functions/helpers/get-progress.ts
+++ b/packages/lambda/src/functions/helpers/get-progress.ts
@@ -106,6 +106,7 @@ export const getProgress = async ({
outBucket: outData.renderBucketName,
mostExpensiveFrameRanges: postRenderData.mostExpensiveFrameRanges ?? null,
timeToEncode: postRenderData.timeToEncode,
+ outputSizeInBytes: postRenderData.outputSize,
};
}
@@ -312,5 +313,6 @@ export const getProgress = async ({
: null,
mostExpensiveFrameRanges: null,
timeToEncode: null,
+ outputSizeInBytes: null,
};
};
diff --git a/packages/lambda/src/shared/constants.ts b/packages/lambda/src/shared/constants.ts
index 7a2c24fd15..6eab863baa 100644
--- a/packages/lambda/src/shared/constants.ts
+++ b/packages/lambda/src/shared/constants.ts
@@ -448,6 +448,7 @@ export type RenderProgress = {
retriesInfo: ChunkRetry[];
mostExpensiveFrameRanges: ExpensiveChunk[] | null;
framesRendered: number;
+ outputSizeInBytes: number | null;
};
export type Privacy = 'public' | 'private' | 'no-acl';