@remotion/lambda 4.0.0-bitrate.16 → 4.0.0-copy.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +8 -8
- package/dist/admin/bundle-lambda.d.ts +0 -0
- package/dist/admin/bundle-lambda.js +0 -0
- package/dist/admin/make-layer-public.d.ts +0 -0
- package/dist/admin/make-layer-public.js +0 -0
- package/dist/api/bucket-exists.d.ts +0 -0
- package/dist/api/bucket-exists.js +0 -0
- package/dist/api/clean-items.d.ts +0 -0
- package/dist/api/clean-items.js +0 -0
- package/dist/api/create-bucket.d.ts +0 -0
- package/dist/api/create-bucket.js +0 -0
- package/dist/api/create-function.d.ts +0 -0
- package/dist/api/create-function.js +0 -0
- package/dist/api/delete-function.d.ts +0 -0
- package/dist/api/delete-function.js +0 -0
- package/dist/api/delete-render.d.ts +0 -0
- package/dist/api/delete-render.js +0 -0
- package/dist/api/delete-site.d.ts +0 -0
- package/dist/api/delete-site.js +0 -0
- package/dist/api/deploy-function.d.ts +0 -0
- package/dist/api/deploy-function.js +0 -0
- package/dist/api/deploy-site.d.ts +0 -0
- package/dist/api/deploy-site.js +0 -0
- package/dist/api/download-media.d.ts +0 -0
- package/dist/api/download-media.js +0 -0
- package/dist/api/enable-s3-website.d.ts +0 -0
- package/dist/api/enable-s3-website.js +0 -0
- package/dist/api/estimate-price.d.ts +0 -0
- package/dist/api/estimate-price.js +0 -0
- package/dist/api/get-aws-client.d.ts +0 -0
- package/dist/api/get-aws-client.js +0 -0
- package/dist/api/get-buckets.d.ts +0 -0
- package/dist/api/get-buckets.js +0 -0
- package/dist/api/get-compositions-on-lambda.d.ts +28 -0
- package/dist/api/get-compositions-on-lambda.js +54 -0
- package/dist/api/get-function-info.d.ts +0 -0
- package/dist/api/get-function-info.js +0 -0
- package/dist/api/get-functions.d.ts +0 -0
- package/dist/api/get-functions.js +0 -0
- package/dist/api/get-or-create-bucket.d.ts +0 -0
- package/dist/api/get-or-create-bucket.js +0 -0
- package/dist/api/get-regions.d.ts +0 -0
- package/dist/api/get-regions.js +0 -0
- package/dist/api/get-render-progress.d.ts +0 -0
- package/dist/api/get-render-progress.js +0 -0
- package/dist/api/get-sites.d.ts +0 -0
- package/dist/api/get-sites.js +0 -0
- package/dist/api/iam-validation/role-permissions.d.ts +0 -0
- package/dist/api/iam-validation/role-permissions.js +0 -0
- package/dist/api/iam-validation/simulate-rule.d.ts +0 -0
- package/dist/api/iam-validation/simulate-rule.js +0 -0
- package/dist/api/iam-validation/simulate.d.ts +0 -0
- package/dist/api/iam-validation/simulate.js +0 -0
- package/dist/api/iam-validation/suggested-policy.d.ts +0 -0
- package/dist/api/iam-validation/suggested-policy.js +0 -0
- package/dist/api/iam-validation/user-permissions.d.ts +0 -0
- package/dist/api/iam-validation/user-permissions.js +0 -0
- package/dist/api/mock-functions.d.ts +0 -0
- package/dist/api/mock-functions.js +0 -0
- package/dist/api/presign-url.d.ts +0 -0
- package/dist/api/presign-url.js +0 -0
- package/dist/api/render-media-on-lambda.d.ts +5 -2
- package/dist/api/render-media-on-lambda.js +22 -7
- package/dist/api/render-still-on-lambda.d.ts +3 -1
- package/dist/api/render-still-on-lambda.js +12 -4
- package/dist/api/upload-dir.d.ts +0 -0
- package/dist/api/upload-dir.js +0 -0
- package/dist/api/validate-webhook-signature.d.ts +0 -0
- package/dist/api/validate-webhook-signature.js +0 -0
- package/dist/cli/args.d.ts +2 -2
- package/dist/cli/args.js +1 -5
- package/dist/cli/commands/compositions/index.d.ts +2 -0
- package/dist/cli/commands/compositions/index.js +44 -0
- package/dist/cli/commands/functions/deploy.d.ts +0 -0
- package/dist/cli/commands/functions/deploy.js +0 -0
- package/dist/cli/commands/functions/index.d.ts +0 -0
- package/dist/cli/commands/functions/index.js +0 -0
- package/dist/cli/commands/functions/ls.d.ts +0 -0
- package/dist/cli/commands/functions/ls.js +0 -0
- package/dist/cli/commands/functions/rm.d.ts +0 -0
- package/dist/cli/commands/functions/rm.js +0 -0
- package/dist/cli/commands/functions/rmall.d.ts +0 -0
- package/dist/cli/commands/functions/rmall.js +0 -0
- package/dist/cli/commands/policies/policies.d.ts +0 -0
- package/dist/cli/commands/policies/policies.js +0 -0
- package/dist/cli/commands/policies/role.d.ts +0 -0
- package/dist/cli/commands/policies/role.js +0 -0
- package/dist/cli/commands/policies/user.d.ts +0 -0
- package/dist/cli/commands/policies/user.js +0 -0
- package/dist/cli/commands/policies/validate.d.ts +0 -0
- package/dist/cli/commands/policies/validate.js +0 -0
- package/dist/cli/commands/quotas/increase.d.ts +0 -0
- package/dist/cli/commands/quotas/increase.js +0 -0
- package/dist/cli/commands/quotas/index.d.ts +0 -0
- package/dist/cli/commands/quotas/index.js +0 -0
- package/dist/cli/commands/quotas/list.d.ts +0 -0
- package/dist/cli/commands/quotas/list.js +0 -0
- package/dist/cli/commands/regions.d.ts +0 -0
- package/dist/cli/commands/regions.js +0 -0
- package/dist/cli/commands/render/progress.d.ts +2 -1
- package/dist/cli/commands/render/progress.js +10 -3
- package/dist/cli/commands/render/render.d.ts +1 -1
- package/dist/cli/commands/render/render.js +23 -10
- package/dist/cli/commands/sites/create.d.ts +1 -1
- package/dist/cli/commands/sites/create.js +9 -4
- package/dist/cli/commands/sites/index.d.ts +1 -1
- package/dist/cli/commands/sites/index.js +2 -2
- package/dist/cli/commands/sites/ls.d.ts +0 -0
- package/dist/cli/commands/sites/ls.js +0 -0
- package/dist/cli/commands/sites/rm.d.ts +0 -0
- package/dist/cli/commands/sites/rm.js +0 -0
- package/dist/cli/commands/sites/rmall.d.ts +0 -0
- package/dist/cli/commands/sites/rmall.js +0 -0
- package/dist/cli/commands/still.d.ts +1 -1
- package/dist/cli/commands/still.js +19 -11
- package/dist/cli/get-aws-region.d.ts +0 -0
- package/dist/cli/get-aws-region.js +0 -0
- package/dist/cli/help.d.ts +0 -0
- package/dist/cli/help.js +0 -0
- package/dist/cli/helpers/confirm.d.ts +0 -0
- package/dist/cli/helpers/confirm.js +0 -0
- package/dist/cli/helpers/date-string.d.ts +0 -0
- package/dist/cli/helpers/date-string.js +0 -0
- package/dist/cli/helpers/find-function-name.d.ts +0 -0
- package/dist/cli/helpers/find-function-name.js +0 -0
- package/dist/cli/helpers/progress-bar.d.ts +0 -0
- package/dist/cli/helpers/progress-bar.js +0 -0
- package/dist/cli/helpers/quit.d.ts +0 -0
- package/dist/cli/helpers/quit.js +0 -0
- package/dist/cli/helpers/yes-or-no.d.ts +0 -0
- package/dist/cli/helpers/yes-or-no.js +0 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +14 -8
- package/dist/cli/is-cli.d.ts +0 -0
- package/dist/cli/is-cli.js +0 -0
- package/dist/cli/log.d.ts +0 -0
- package/dist/cli/log.js +0 -0
- package/dist/client.d.ts +2 -1
- package/dist/client.js +3 -1
- package/dist/defaults.d.ts +0 -0
- package/dist/defaults.js +0 -0
- package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -5
- package/dist/functions/chunk-optimization/plan-frame-ranges.js +1 -14
- package/dist/functions/chunk-optimization/types.d.ts +0 -11
- package/dist/functions/chunk-optimization/types.js +0 -0
- package/dist/functions/compositions.d.ts +8 -0
- package/dist/functions/compositions.js +50 -0
- package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +0 -0
- package/dist/functions/helpers/best-frames-per-lambda-param.js +0 -0
- package/dist/functions/helpers/calculate-chunk-times.d.ts +0 -0
- package/dist/functions/helpers/calculate-chunk-times.js +0 -0
- package/dist/functions/helpers/calculate-price-from-bucket.d.ts +0 -0
- package/dist/functions/helpers/calculate-price-from-bucket.js +0 -0
- package/dist/functions/helpers/check-if-render-exists.d.ts +0 -0
- package/dist/functions/helpers/check-if-render-exists.js +0 -0
- package/dist/functions/helpers/clean-tmpdir.d.ts +0 -0
- package/dist/functions/helpers/clean-tmpdir.js +1 -1
- package/dist/functions/helpers/concat-videos.d.ts +6 -1
- package/dist/functions/helpers/concat-videos.js +27 -9
- package/dist/functions/helpers/create-post-render-data.d.ts +0 -0
- package/dist/functions/helpers/create-post-render-data.js +0 -0
- package/dist/functions/helpers/delete-chunks.d.ts +0 -0
- package/dist/functions/helpers/delete-chunks.js +0 -0
- package/dist/functions/helpers/expected-out-name.d.ts +0 -0
- package/dist/functions/helpers/expected-out-name.js +0 -0
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +0 -0
- package/dist/functions/helpers/find-output-file-in-bucket.js +0 -0
- package/dist/functions/helpers/format-costs-info.d.ts +0 -0
- package/dist/functions/helpers/format-costs-info.js +0 -0
- package/dist/functions/helpers/get-browser-instance.d.ts +0 -0
- package/dist/functions/helpers/get-browser-instance.js +1 -1
- package/dist/functions/helpers/get-chromium-executable-path.d.ts +0 -0
- package/dist/functions/helpers/get-chromium-executable-path.js +0 -0
- package/dist/functions/helpers/get-cleanup-progress.d.ts +0 -0
- package/dist/functions/helpers/get-cleanup-progress.js +0 -0
- package/dist/functions/helpers/get-current-architecture.d.ts +0 -0
- package/dist/functions/helpers/get-current-architecture.js +0 -0
- package/dist/functions/helpers/get-current-region.d.ts +0 -0
- package/dist/functions/helpers/get-current-region.js +0 -0
- package/dist/functions/helpers/get-custom-out-name.d.ts +0 -0
- package/dist/functions/helpers/get-custom-out-name.js +1 -1
- package/dist/functions/helpers/get-encoding-metadata.d.ts +0 -0
- package/dist/functions/helpers/get-encoding-metadata.js +0 -0
- package/dist/functions/helpers/get-files-in-folder.d.ts +0 -0
- package/dist/functions/helpers/get-files-in-folder.js +0 -0
- package/dist/functions/helpers/get-files-to-delete.d.ts +0 -0
- package/dist/functions/helpers/get-files-to-delete.js +0 -0
- package/dist/functions/helpers/get-final-encoding-status.d.ts +0 -0
- package/dist/functions/helpers/get-final-encoding-status.js +0 -0
- package/dist/functions/helpers/get-folder-size.d.ts +0 -0
- package/dist/functions/helpers/get-folder-size.js +0 -0
- package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +0 -0
- package/dist/functions/helpers/get-lambdas-invoked-stats.js +0 -0
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +0 -0
- package/dist/functions/helpers/get-output-url-from-metadata.js +0 -0
- package/dist/functions/helpers/get-overall-progress.d.ts +0 -0
- package/dist/functions/helpers/get-overall-progress.js +0 -0
- package/dist/functions/helpers/get-post-render-data.d.ts +0 -0
- package/dist/functions/helpers/get-post-render-data.js +0 -0
- package/dist/functions/helpers/get-progress.d.ts +0 -0
- package/dist/functions/helpers/get-progress.js +0 -0
- package/dist/functions/helpers/get-render-metadata.d.ts +0 -0
- package/dist/functions/helpers/get-render-metadata.js +0 -0
- package/dist/functions/helpers/get-retry-stats.d.ts +0 -0
- package/dist/functions/helpers/get-retry-stats.js +0 -0
- package/dist/functions/helpers/get-time-to-finish.d.ts +0 -0
- package/dist/functions/helpers/get-time-to-finish.js +0 -0
- package/dist/functions/helpers/inspect-errors.d.ts +0 -0
- package/dist/functions/helpers/inspect-errors.js +0 -0
- package/dist/functions/helpers/io.d.ts +0 -0
- package/dist/functions/helpers/io.js +3 -1
- package/dist/functions/helpers/is-enosp-err.d.ts +0 -0
- package/dist/functions/helpers/is-enosp-err.js +0 -0
- package/dist/functions/helpers/is-warm.d.ts +0 -0
- package/dist/functions/helpers/is-warm.js +0 -0
- package/dist/functions/helpers/min-max.d.ts +0 -0
- package/dist/functions/helpers/min-max.js +0 -0
- package/dist/functions/helpers/print-cloudwatch-helper.d.ts +0 -0
- package/dist/functions/helpers/print-cloudwatch-helper.js +0 -0
- package/dist/functions/helpers/print-concurrency-curve.d.ts +0 -0
- package/dist/functions/helpers/print-concurrency-curve.js +0 -0
- package/dist/functions/helpers/read-with-progress.d.ts +0 -0
- package/dist/functions/helpers/read-with-progress.js +1 -1
- package/dist/functions/helpers/timer.d.ts +0 -0
- package/dist/functions/helpers/timer.js +0 -0
- package/dist/functions/helpers/validate-composition.d.ts +3 -1
- package/dist/functions/helpers/validate-composition.js +6 -2
- package/dist/functions/helpers/write-lambda-error.d.ts +0 -0
- package/dist/functions/helpers/write-lambda-error.js +0 -0
- package/dist/functions/helpers/write-post-render-data.d.ts +0 -0
- package/dist/functions/helpers/write-post-render-data.js +0 -0
- package/dist/functions/index.d.ts +0 -0
- package/dist/functions/index.js +13 -1
- package/dist/functions/info.d.ts +0 -0
- package/dist/functions/info.js +0 -0
- package/dist/functions/launch.d.ts +1 -0
- package/dist/functions/launch.js +68 -71
- package/dist/functions/progress.d.ts +0 -0
- package/dist/functions/progress.js +2 -2
- package/dist/functions/renderer.d.ts +0 -0
- package/dist/functions/renderer.js +10 -2
- package/dist/functions/start.d.ts +0 -0
- package/dist/functions/start.js +6 -2
- package/dist/functions/still.d.ts +0 -0
- package/dist/functions/still.js +22 -6
- package/dist/index.d.ts +6 -2
- package/dist/index.js +3 -1
- package/dist/internals.d.ts +1 -1
- package/dist/internals.js +0 -0
- package/dist/pricing/aws-regions.d.ts +0 -0
- package/dist/pricing/aws-regions.js +0 -0
- package/dist/pricing/price-per-1-s.d.ts +0 -0
- package/dist/pricing/price-per-1-s.js +0 -0
- package/dist/regions.d.ts +0 -0
- package/dist/regions.js +0 -0
- package/dist/shared/await.d.ts +0 -0
- package/dist/shared/await.js +0 -0
- package/dist/shared/aws-clients.d.ts +0 -0
- package/dist/shared/aws-clients.js +0 -0
- package/dist/shared/bundle-site.d.ts +0 -0
- package/dist/shared/bundle-site.js +0 -0
- package/dist/shared/call-lambda.d.ts +0 -0
- package/dist/shared/call-lambda.js +0 -0
- package/dist/shared/check-credentials.d.ts +0 -0
- package/dist/shared/check-credentials.js +0 -0
- package/dist/shared/cleanup-serialized-input-props.d.ts +7 -0
- package/dist/shared/cleanup-serialized-input-props.js +19 -0
- package/dist/shared/constants.d.ts +37 -14
- package/dist/shared/constants.js +6 -3
- package/dist/shared/content-disposition-header.d.ts +0 -0
- package/dist/shared/content-disposition-header.js +0 -0
- package/dist/shared/convert-to-serve-url.d.ts +0 -0
- package/dist/shared/convert-to-serve-url.js +0 -0
- package/dist/shared/deserialize-input-props.d.ts +8 -0
- package/dist/shared/deserialize-input-props.js +26 -0
- package/dist/shared/docs-url.d.ts +0 -0
- package/dist/shared/docs-url.js +0 -0
- package/dist/shared/function-zip-path.d.ts +0 -0
- package/dist/shared/function-zip-path.js +0 -0
- package/dist/shared/get-account-id.d.ts +0 -0
- package/dist/shared/get-account-id.js +0 -0
- package/dist/shared/get-aws-urls.d.ts +13 -0
- package/dist/{cli/helpers/get-cloudwatch-stream-url.js → shared/get-aws-urls.js} +5 -1
- package/dist/shared/get-cloudwatch-stream-url.d.ts +0 -0
- package/dist/shared/get-cloudwatch-stream-url.js +0 -0
- package/dist/shared/get-function-version.d.ts +0 -0
- package/dist/shared/get-function-version.js +0 -0
- package/dist/shared/get-most-expensive-chunks.d.ts +0 -0
- package/dist/shared/get-most-expensive-chunks.js +0 -0
- package/dist/shared/hosted-layers.d.ts +0 -0
- package/dist/shared/hosted-layers.js +0 -0
- package/dist/shared/invoke-webhook.d.ts +0 -0
- package/dist/shared/invoke-webhook.js +0 -0
- package/dist/shared/is-in-lambda.d.ts +0 -0
- package/dist/shared/is-in-lambda.js +0 -0
- package/dist/shared/lambda-version-string.d.ts +0 -0
- package/dist/shared/lambda-version-string.js +0 -0
- package/dist/shared/make-s3-key.d.ts +0 -0
- package/dist/shared/make-s3-key.js +0 -0
- package/dist/shared/make-s3-url.d.ts +0 -0
- package/dist/shared/make-s3-url.js +0 -0
- package/dist/shared/p-limit.d.ts +0 -0
- package/dist/shared/p-limit.js +0 -0
- package/dist/shared/parse-lambda-initialized-key.d.ts +0 -0
- package/dist/shared/parse-lambda-initialized-key.js +0 -0
- package/dist/shared/parse-lambda-timings-key.d.ts +0 -0
- package/dist/shared/parse-lambda-timings-key.js +0 -0
- package/dist/shared/random-hash.d.ts +0 -0
- package/dist/shared/random-hash.js +0 -0
- package/dist/shared/return-values.d.ts +2 -0
- package/dist/shared/return-values.js +0 -0
- package/dist/shared/serialize-input-props.d.ts +7 -0
- package/dist/shared/serialize-input-props.js +42 -0
- package/dist/shared/sleep.d.ts +0 -0
- package/dist/shared/sleep.js +0 -0
- package/dist/shared/stream-to-string.d.ts +0 -0
- package/dist/shared/stream-to-string.js +0 -0
- package/dist/shared/truthy.d.ts +0 -0
- package/dist/shared/truthy.js +0 -0
- package/dist/shared/validate-architecture.d.ts +0 -0
- package/dist/shared/validate-architecture.js +0 -0
- package/dist/shared/validate-aws-region.d.ts +0 -0
- package/dist/shared/validate-aws-region.js +0 -0
- package/dist/shared/validate-bucketname.d.ts +0 -0
- package/dist/shared/validate-bucketname.js +0 -0
- package/dist/shared/validate-custom-role-arn.d.ts +0 -0
- package/dist/shared/validate-custom-role-arn.js +0 -0
- package/dist/shared/validate-disk-size-in-mb.d.ts +0 -0
- package/dist/shared/validate-disk-size-in-mb.js +0 -0
- package/dist/shared/validate-download-behavior.d.ts +0 -0
- package/dist/shared/validate-download-behavior.js +0 -0
- package/dist/shared/validate-frames-per-lambda.d.ts +0 -0
- package/dist/shared/validate-frames-per-lambda.js +0 -0
- package/dist/shared/validate-lambda-codec.d.ts +0 -0
- package/dist/shared/validate-lambda-codec.js +0 -0
- package/dist/shared/validate-memory-size.d.ts +0 -0
- package/dist/shared/validate-memory-size.js +0 -0
- package/dist/shared/validate-outname.d.ts +0 -0
- package/dist/shared/validate-outname.js +0 -0
- package/dist/shared/validate-presign-expiration.d.ts +0 -0
- package/dist/shared/validate-presign-expiration.js +0 -0
- package/dist/shared/validate-privacy.d.ts +0 -0
- package/dist/shared/validate-privacy.js +0 -0
- package/dist/shared/validate-retention-period.d.ts +0 -0
- package/dist/shared/validate-retention-period.js +0 -0
- package/dist/shared/validate-retries.d.ts +0 -0
- package/dist/shared/validate-retries.js +0 -0
- package/dist/shared/validate-serveurl.d.ts +0 -0
- package/dist/shared/validate-serveurl.js +0 -0
- package/dist/shared/validate-site-name.d.ts +0 -0
- package/dist/shared/validate-site-name.js +0 -0
- package/dist/shared/validate-timeout.d.ts +0 -0
- package/dist/shared/validate-timeout.js +0 -0
- package/package.json +19 -22
- package/remotionlambda.zip +0 -0
- package/dist/cli/helpers/determine-image-format.d.ts +0 -10
- package/dist/cli/helpers/determine-image-format.js +0 -47
- package/dist/cli/helpers/get-cloudwatch-stream-url.d.ts +0 -8
- package/dist/cli/helpers/webhook-types.d.ts +0 -6
- package/dist/cli/helpers/webhook-types.js +0 -2
- package/dist/functions/chunk-optimization/can-use-optimization.d.ts +0 -6
- package/dist/functions/chunk-optimization/can-use-optimization.js +0 -23
- package/dist/functions/chunk-optimization/collect-data.d.ts +0 -9
- package/dist/functions/chunk-optimization/collect-data.js +0 -27
- package/dist/functions/chunk-optimization/get-frame-ranges-from-profile.d.ts +0 -3
- package/dist/functions/chunk-optimization/get-frame-ranges-from-profile.js +0 -11
- package/dist/functions/chunk-optimization/get-profile-duration.d.ts +0 -3
- package/dist/functions/chunk-optimization/get-profile-duration.js +0 -18
- package/dist/functions/chunk-optimization/is-valid-profile.d.ts +0 -2
- package/dist/functions/chunk-optimization/is-valid-profile.js +0 -12
- package/dist/functions/chunk-optimization/optimize-invocation-order.d.ts +0 -2
- package/dist/functions/chunk-optimization/optimize-invocation-order.js +0 -19
- package/dist/functions/chunk-optimization/optimize-profile.d.ts +0 -9
- package/dist/functions/chunk-optimization/optimize-profile.js +0 -74
- package/dist/functions/chunk-optimization/s3-optimization-file.d.ts +0 -17
- package/dist/functions/chunk-optimization/s3-optimization-file.js +0 -47
- package/dist/functions/chunk-optimization/simulate-frame-ranges.d.ts +0 -7
- package/dist/functions/chunk-optimization/simulate-frame-ranges.js +0 -47
- package/dist/functions/chunk-optimization/sort-by-duration.d.ts +0 -2
- package/dist/functions/chunk-optimization/sort-by-duration.js +0 -25
package/dist/functions/launch.js
CHANGED
|
@@ -10,21 +10,16 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
10
10
|
const remotion_1 = require("remotion");
|
|
11
11
|
const version_1 = require("remotion/version");
|
|
12
12
|
const aws_clients_1 = require("../shared/aws-clients");
|
|
13
|
+
const cleanup_serialized_input_props_1 = require("../shared/cleanup-serialized-input-props");
|
|
13
14
|
const constants_1 = require("../shared/constants");
|
|
15
|
+
const deserialize_input_props_1 = require("../shared/deserialize-input-props");
|
|
14
16
|
const docs_url_1 = require("../shared/docs-url");
|
|
15
17
|
const invoke_webhook_1 = require("../shared/invoke-webhook");
|
|
16
18
|
const make_s3_url_1 = require("../shared/make-s3-url");
|
|
17
19
|
const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lambda");
|
|
18
20
|
const validate_outname_1 = require("../shared/validate-outname");
|
|
19
21
|
const validate_privacy_1 = require("../shared/validate-privacy");
|
|
20
|
-
const collect_data_1 = require("./chunk-optimization/collect-data");
|
|
21
|
-
const get_frame_ranges_from_profile_1 = require("./chunk-optimization/get-frame-ranges-from-profile");
|
|
22
|
-
const get_profile_duration_1 = require("./chunk-optimization/get-profile-duration");
|
|
23
|
-
const is_valid_profile_1 = require("./chunk-optimization/is-valid-profile");
|
|
24
|
-
const optimize_invocation_order_1 = require("./chunk-optimization/optimize-invocation-order");
|
|
25
|
-
const optimize_profile_1 = require("./chunk-optimization/optimize-profile");
|
|
26
22
|
const plan_frame_ranges_1 = require("./chunk-optimization/plan-frame-ranges");
|
|
27
|
-
const s3_optimization_file_1 = require("./chunk-optimization/s3-optimization-file");
|
|
28
23
|
const best_frames_per_lambda_param_1 = require("./helpers/best-frames-per-lambda-param");
|
|
29
24
|
const concat_videos_1 = require("./helpers/concat-videos");
|
|
30
25
|
const create_post_render_data_1 = require("./helpers/create-post-render-data");
|
|
@@ -70,6 +65,8 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
70
65
|
}
|
|
71
66
|
const startedDate = Date.now();
|
|
72
67
|
let webhookInvoked = false;
|
|
68
|
+
console.log(`Function has ${Math.max(options.getRemainingTimeInMillis() - 1000, 1000)} before it times out`);
|
|
69
|
+
const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose');
|
|
73
70
|
const webhookDueToTimeout = setTimeout(async () => {
|
|
74
71
|
if (params.webhook && !webhookInvoked) {
|
|
75
72
|
try {
|
|
@@ -111,23 +108,20 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
111
108
|
console.log(err);
|
|
112
109
|
}
|
|
113
110
|
}
|
|
114
|
-
}, Math.max(
|
|
115
|
-
const
|
|
116
|
-
(0, get_browser_instance_1.getBrowserInstance)(renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'), params.chromiumOptions),
|
|
117
|
-
(0, s3_optimization_file_1.getOptimization)({
|
|
118
|
-
bucketName: params.bucketName,
|
|
119
|
-
siteId: (0, make_s3_url_1.getServeUrlHash)(params.serveUrl),
|
|
120
|
-
compositionId: params.composition,
|
|
121
|
-
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
122
|
-
expectedBucketOwner: options.expectedBucketOwner,
|
|
123
|
-
}),
|
|
124
|
-
]);
|
|
111
|
+
}, Math.max(options.getRemainingTimeInMillis() - 1000, 1000));
|
|
112
|
+
const browserInstance = await (0, get_browser_instance_1.getBrowserInstance)(verbose, params.chromiumOptions);
|
|
125
113
|
const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
|
|
114
|
+
const inputPropsPromise = (0, deserialize_input_props_1.deserializeInputProps)({
|
|
115
|
+
bucketName: params.bucketName,
|
|
116
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
117
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
118
|
+
serialized: params.inputProps,
|
|
119
|
+
});
|
|
126
120
|
const comp = await (0, validate_composition_1.validateComposition)({
|
|
127
121
|
serveUrl: params.serveUrl,
|
|
128
122
|
composition: params.composition,
|
|
129
123
|
browserInstance,
|
|
130
|
-
inputProps:
|
|
124
|
+
inputProps: await inputPropsPromise,
|
|
131
125
|
envVariables: params.envVariables,
|
|
132
126
|
ffmpegExecutable: null,
|
|
133
127
|
ffprobeExecutable: null,
|
|
@@ -135,11 +129,15 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
135
129
|
chromiumOptions: params.chromiumOptions,
|
|
136
130
|
port: null,
|
|
137
131
|
downloadMap,
|
|
132
|
+
forceHeight: params.forceHeight,
|
|
133
|
+
forceWidth: params.forceWidth,
|
|
138
134
|
});
|
|
139
135
|
remotion_1.Internals.validateDurationInFrames(comp.durationInFrames, 'passed to a Lambda render');
|
|
140
136
|
remotion_1.Internals.validateFps(comp.fps, 'passed to a Lambda render', false);
|
|
141
137
|
remotion_1.Internals.validateDimension(comp.height, 'height', 'passed to a Lambda render');
|
|
142
138
|
remotion_1.Internals.validateDimension(comp.width, 'width', 'passed to a Lambda render');
|
|
139
|
+
renderer_1.RenderInternals.validateBitrate(params.audioBitrate, 'audioBitrate');
|
|
140
|
+
renderer_1.RenderInternals.validateBitrate(params.videoBitrate, 'videoBitrate');
|
|
143
141
|
renderer_1.RenderInternals.validateConcurrency(params.concurrencyPerLambda, 'concurrencyPerLambda');
|
|
144
142
|
const realFrameRange = renderer_1.RenderInternals.getRealFrameRange(comp.durationInFrames, params.frameRange);
|
|
145
143
|
const frameCount = renderer_1.RenderInternals.getFramesToRender(realFrameRange, params.everyNthFrame);
|
|
@@ -150,16 +148,13 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
150
148
|
});
|
|
151
149
|
const chunkCount = Math.ceil(frameCount.length / framesPerLambda);
|
|
152
150
|
if (chunkCount > constants_1.MAX_FUNCTIONS_PER_RENDER) {
|
|
153
|
-
throw new Error(`Too many functions: This render would cause ${chunkCount} functions to spawn. We limit this amount to ${constants_1.MAX_FUNCTIONS_PER_RENDER} functions as more would result in diminishing returns. Values set: frameCount = ${frameCount}, framesPerLambda=${framesPerLambda}. See ${docs_url_1.DOCS_URL}/docs/lambda/concurrency for
|
|
151
|
+
throw new Error(`Too many functions: This render would cause ${chunkCount} functions to spawn. We limit this amount to ${constants_1.MAX_FUNCTIONS_PER_RENDER} functions as more would result in diminishing returns. Values set: frameCount = ${frameCount}, framesPerLambda=${framesPerLambda}. See ${docs_url_1.DOCS_URL}/docs/lambda/concurrency#too-many-functions for help.`);
|
|
154
152
|
}
|
|
155
153
|
(0, validate_outname_1.validateOutname)(params.outName, params.codec);
|
|
156
154
|
(0, validate_privacy_1.validatePrivacy)(params.privacy);
|
|
157
155
|
renderer_1.RenderInternals.validatePuppeteerTimeout(params.timeoutInMilliseconds);
|
|
158
|
-
const { chunks
|
|
156
|
+
const { chunks } = (0, plan_frame_ranges_1.planFrameRanges)({
|
|
159
157
|
framesPerLambda,
|
|
160
|
-
optimization,
|
|
161
|
-
// TODO: Re-enable chunk optimization later
|
|
162
|
-
shouldUseOptimization: false,
|
|
163
158
|
frameRange: realFrameRange,
|
|
164
159
|
everyNthFrame: params.everyNthFrame,
|
|
165
160
|
});
|
|
@@ -198,6 +193,8 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
198
193
|
everyNthFrame: params.everyNthFrame,
|
|
199
194
|
concurrencyPerLambda: params.concurrencyPerLambda,
|
|
200
195
|
muted: params.muted,
|
|
196
|
+
audioBitrate: params.audioBitrate,
|
|
197
|
+
videoBitrate: params.videoBitrate,
|
|
201
198
|
};
|
|
202
199
|
return payload;
|
|
203
200
|
});
|
|
@@ -216,7 +213,6 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
216
213
|
compositionId: comp.id,
|
|
217
214
|
siteId: (0, make_s3_url_1.getServeUrlHash)(params.serveUrl),
|
|
218
215
|
codec: params.codec,
|
|
219
|
-
usesOptimizationProfile: didUseOptimization,
|
|
220
216
|
type: 'video',
|
|
221
217
|
imageFormat: params.imageFormat,
|
|
222
218
|
inputProps: params.inputProps,
|
|
@@ -315,6 +311,32 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
315
311
|
});
|
|
316
312
|
});
|
|
317
313
|
};
|
|
314
|
+
const onErrors = async (errors) => {
|
|
315
|
+
var _a;
|
|
316
|
+
console.log('Found Errors', errors);
|
|
317
|
+
if (params.webhook) {
|
|
318
|
+
console.log('Sending webhook with errors');
|
|
319
|
+
await (0, invoke_webhook_1.invokeWebhook)({
|
|
320
|
+
url: params.webhook.url,
|
|
321
|
+
secret: (_a = params.webhook.secret) !== null && _a !== void 0 ? _a : null,
|
|
322
|
+
payload: {
|
|
323
|
+
type: 'error',
|
|
324
|
+
renderId: params.renderId,
|
|
325
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
326
|
+
bucketName: params.bucketName,
|
|
327
|
+
errors: errors.slice(0, 5).map((e) => ({
|
|
328
|
+
message: e.message,
|
|
329
|
+
name: e.name,
|
|
330
|
+
stack: e.stack,
|
|
331
|
+
})),
|
|
332
|
+
},
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
console.log('No webhook specified');
|
|
337
|
+
}
|
|
338
|
+
throw new Error('Stopping Lambda function because error occurred: ' + errors[0].stack);
|
|
339
|
+
};
|
|
318
340
|
const fps = comp.fps / params.everyNthFrame;
|
|
319
341
|
const { outfile, cleanupChunksProm, encodingStart } = await (0, concat_videos_1.concatVideosS3)({
|
|
320
342
|
bucket: params.bucketName,
|
|
@@ -327,6 +349,9 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
327
349
|
expectedBucketOwner: options.expectedBucketOwner,
|
|
328
350
|
fps,
|
|
329
351
|
numberOfGifLoops: params.numberOfGifLoops,
|
|
352
|
+
ffmpegExecutable: null,
|
|
353
|
+
remotionRoot: process.cwd(),
|
|
354
|
+
onErrors,
|
|
330
355
|
});
|
|
331
356
|
if (!encodingStop) {
|
|
332
357
|
encodingStop = Date.now();
|
|
@@ -342,47 +367,12 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
342
367
|
downloadBehavior: params.downloadBehavior,
|
|
343
368
|
customCredentials,
|
|
344
369
|
});
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
renderId: params.renderId,
|
|
352
|
-
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
353
|
-
expectedBucketOwner: options.expectedBucketOwner,
|
|
354
|
-
});
|
|
355
|
-
const optimizedProfile = (0, optimize_invocation_order_1.optimizeInvocationOrder)((0, optimize_profile_1.optimizeProfileRecursively)(chunkData, 400));
|
|
356
|
-
const optimizedFrameRange = (0, get_frame_ranges_from_profile_1.getFrameRangesFromProfile)(optimizedProfile);
|
|
357
|
-
chunkProm = (0, is_valid_profile_1.isValidOptimizationProfile)(optimizedProfile)
|
|
358
|
-
? (0, s3_optimization_file_1.writeOptimization)({
|
|
359
|
-
bucketName: params.bucketName,
|
|
360
|
-
optimization: {
|
|
361
|
-
ranges: optimizedFrameRange,
|
|
362
|
-
oldTiming: (0, get_profile_duration_1.getProfileDuration)(chunkData),
|
|
363
|
-
newTiming: (0, get_profile_duration_1.getProfileDuration)(optimizedProfile),
|
|
364
|
-
createdFromRenderId: params.renderId,
|
|
365
|
-
framesPerLambda,
|
|
366
|
-
lambdaVersion: version_1.VERSION,
|
|
367
|
-
frameRange: realFrameRange,
|
|
368
|
-
everyNthFrame: params.everyNthFrame,
|
|
369
|
-
},
|
|
370
|
-
expectedBucketOwner: options.expectedBucketOwner,
|
|
371
|
-
compositionId: params.composition,
|
|
372
|
-
siteId: (0, make_s3_url_1.getServeUrlHash)(params.serveUrl),
|
|
373
|
-
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
374
|
-
})
|
|
375
|
-
: Promise.resolve();
|
|
376
|
-
}
|
|
377
|
-
const [, contents] = await Promise.all([
|
|
378
|
-
chunkProm,
|
|
379
|
-
(0, io_1.lambdaLs)({
|
|
380
|
-
bucketName: params.bucketName,
|
|
381
|
-
prefix: (0, constants_1.rendersPrefix)(params.renderId),
|
|
382
|
-
expectedBucketOwner: options.expectedBucketOwner,
|
|
383
|
-
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
384
|
-
}),
|
|
385
|
-
]);
|
|
370
|
+
const contents = await (0, io_1.lambdaLs)({
|
|
371
|
+
bucketName: params.bucketName,
|
|
372
|
+
prefix: (0, constants_1.rendersPrefix)(params.renderId),
|
|
373
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
374
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
375
|
+
});
|
|
386
376
|
const finalEncodingProgress = {
|
|
387
377
|
framesEncoded: frameCount.length,
|
|
388
378
|
totalFrames: frameCount.length,
|
|
@@ -416,11 +406,18 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
416
406
|
chunkCount,
|
|
417
407
|
renderId: params.renderId,
|
|
418
408
|
});
|
|
419
|
-
const deletProm =
|
|
409
|
+
const deletProm = verbose
|
|
410
|
+
? Promise.resolve(0)
|
|
411
|
+
: (0, delete_chunks_1.cleanupFiles)({
|
|
412
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
413
|
+
bucket: params.bucketName,
|
|
414
|
+
contents,
|
|
415
|
+
jobs,
|
|
416
|
+
});
|
|
417
|
+
const cleanupSerializedInputPropsProm = (0, cleanup_serialized_input_props_1.cleanupSerializedInputProps)({
|
|
418
|
+
bucketName: params.bucketName,
|
|
420
419
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
421
|
-
|
|
422
|
-
contents,
|
|
423
|
-
jobs,
|
|
420
|
+
serialized: params.inputProps,
|
|
424
421
|
});
|
|
425
422
|
const outputUrl = (0, get_output_url_from_metadata_1.getOutputUrlFromMetadata)(renderMetadata, params.bucketName, customCredentials);
|
|
426
423
|
const postRenderData = (0, create_post_render_data_1.createPostRenderData)({
|
|
@@ -432,7 +429,7 @@ const innerLaunchHandler = async (params, options) => {
|
|
|
432
429
|
contents,
|
|
433
430
|
errorExplanations: await errorExplanationsProm,
|
|
434
431
|
timeToEncode: encodingStop - encodingStart,
|
|
435
|
-
timeToDelete: await deletProm,
|
|
432
|
+
timeToDelete: (await Promise.all([deletProm, cleanupSerializedInputPropsProm])).reduce((a, b) => a + b, 0),
|
|
436
433
|
outputFile: {
|
|
437
434
|
lastModified: Date.now(),
|
|
438
435
|
size: outputSize.size,
|
|
File without changes
|
|
@@ -12,9 +12,9 @@ const progressHandler = (lambdaParams, options) => {
|
|
|
12
12
|
}
|
|
13
13
|
if (lambdaParams.version !== version_1.VERSION) {
|
|
14
14
|
if (!lambdaParams.version) {
|
|
15
|
-
throw new Error(`Version mismatch: When calling getRenderProgress(),
|
|
15
|
+
throw new Error(`Version mismatch: When calling getRenderProgress(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${version_1.VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call getRenderProgress(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
16
16
|
}
|
|
17
|
-
throw new Error(`Version mismatch: When calling getRenderProgress(),
|
|
17
|
+
throw new Error(`Version mismatch: When calling getRenderProgress(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${version_1.VERSION}, but the @remotion/lambda package you used to invoke the function has version ${lambdaParams.version}. Deploy a new function and use it to call getRenderProgress(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
18
18
|
}
|
|
19
19
|
return (0, get_progress_1.getProgress)({
|
|
20
20
|
bucketName: lambdaParams.bucketName,
|
|
File without changes
|
|
@@ -10,6 +10,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
11
|
const aws_clients_1 = require("../shared/aws-clients");
|
|
12
12
|
const constants_1 = require("../shared/constants");
|
|
13
|
+
const deserialize_input_props_1 = require("../shared/deserialize-input-props");
|
|
13
14
|
const clean_tmpdir_1 = require("./helpers/clean-tmpdir");
|
|
14
15
|
const get_browser_instance_1 = require("./helpers/get-browser-instance");
|
|
15
16
|
const get_current_region_1 = require("./helpers/get-current-region");
|
|
@@ -22,6 +23,12 @@ const renderHandler = async (params, options, logs) => {
|
|
|
22
23
|
if (params.type !== constants_1.LambdaRoutines.renderer) {
|
|
23
24
|
throw new Error('Params must be renderer');
|
|
24
25
|
}
|
|
26
|
+
const inputPropsPromise = (0, deserialize_input_props_1.deserializeInputProps)({
|
|
27
|
+
bucketName: params.bucketName,
|
|
28
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
29
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
30
|
+
serialized: params.inputProps,
|
|
31
|
+
});
|
|
25
32
|
const browserInstance = await (0, get_browser_instance_1.getBrowserInstance)(renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'), (_a = params.chromiumOptions) !== null && _a !== void 0 ? _a : {});
|
|
26
33
|
const outputPath = renderer_1.RenderInternals.tmpDir('remotion-render-');
|
|
27
34
|
if (typeof params.chunk !== 'number') {
|
|
@@ -42,6 +49,7 @@ const renderHandler = async (params, options, logs) => {
|
|
|
42
49
|
const chunkCodec = params.codec === 'gif' ? 'h264-mkv' : params.codec;
|
|
43
50
|
const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
|
|
44
51
|
const downloads = {};
|
|
52
|
+
const inputProps = await inputPropsPromise;
|
|
45
53
|
await new Promise((resolve, reject) => {
|
|
46
54
|
var _a;
|
|
47
55
|
(0, renderer_1.renderMedia)({
|
|
@@ -53,7 +61,7 @@ const renderHandler = async (params, options, logs) => {
|
|
|
53
61
|
width: params.width,
|
|
54
62
|
},
|
|
55
63
|
imageFormat: params.imageFormat,
|
|
56
|
-
inputProps
|
|
64
|
+
inputProps,
|
|
57
65
|
frameRange: params.frameRange,
|
|
58
66
|
onProgress: ({ renderedFrames, encodedFrames, stitchStage }) => {
|
|
59
67
|
if (renderedFrames % 10 === 0 &&
|
|
@@ -102,7 +110,6 @@ const renderHandler = async (params, options, logs) => {
|
|
|
102
110
|
outputLocation,
|
|
103
111
|
codec: chunkCodec,
|
|
104
112
|
crf: (_a = params.crf) !== null && _a !== void 0 ? _a : undefined,
|
|
105
|
-
ffmpegExecutable: process.env.NODE_ENV === 'test' ? null : '/opt/bin/ffmpeg',
|
|
106
113
|
pixelFormat: params.pixelFormat,
|
|
107
114
|
proResProfile: params.proResProfile,
|
|
108
115
|
onDownload: (src) => {
|
|
@@ -197,6 +204,7 @@ const rendererHandler = async (params, options) => {
|
|
|
197
204
|
}
|
|
198
205
|
catch (err) {
|
|
199
206
|
if (process.env.NODE_ENV === 'test') {
|
|
207
|
+
console.log({ err });
|
|
200
208
|
throw err;
|
|
201
209
|
}
|
|
202
210
|
// If this error is encountered, we can just retry as it
|
|
File without changes
|
package/dist/functions/start.js
CHANGED
|
@@ -16,9 +16,9 @@ const startHandler = async (params, options) => {
|
|
|
16
16
|
}
|
|
17
17
|
if (params.version !== version_1.VERSION) {
|
|
18
18
|
if (!params.version) {
|
|
19
|
-
throw new Error(`Version mismatch: When calling renderMediaOnLambda(),
|
|
19
|
+
throw new Error(`Version mismatch: When calling renderMediaOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${version_1.VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call renderMediaOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
20
20
|
}
|
|
21
|
-
throw new Error(`Version mismatch: When calling renderMediaOnLambda(),
|
|
21
|
+
throw new Error(`Version mismatch: When calling renderMediaOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${version_1.VERSION}, but the @remotion/lambda package you used to invoke the function has version ${params.version}. Deploy a new function and use it to call renderMediaOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
22
22
|
}
|
|
23
23
|
const { bucketName } = await (0, get_or_create_bucket_1.getOrCreateBucket)({
|
|
24
24
|
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
@@ -64,6 +64,10 @@ const startHandler = async (params, options) => {
|
|
|
64
64
|
muted: params.muted,
|
|
65
65
|
overwrite: params.overwrite,
|
|
66
66
|
webhook: params.webhook,
|
|
67
|
+
audioBitrate: params.audioBitrate,
|
|
68
|
+
videoBitrate: params.videoBitrate,
|
|
69
|
+
forceHeight: params.forceHeight,
|
|
70
|
+
forceWidth: params.forceWidth,
|
|
67
71
|
};
|
|
68
72
|
await (0, aws_clients_1.getLambdaClient)((0, get_current_region_1.getCurrentRegionInFunction)()).send(new client_lambda_1.InvokeCommand({
|
|
69
73
|
FunctionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
|
File without changes
|
package/dist/functions/still.js
CHANGED
|
@@ -12,7 +12,9 @@ const version_1 = require("remotion/version");
|
|
|
12
12
|
const estimate_price_1 = require("../api/estimate-price");
|
|
13
13
|
const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
|
|
14
14
|
const aws_clients_1 = require("../shared/aws-clients");
|
|
15
|
+
const cleanup_serialized_input_props_1 = require("../shared/cleanup-serialized-input-props");
|
|
15
16
|
const constants_1 = require("../shared/constants");
|
|
17
|
+
const deserialize_input_props_1 = require("../shared/deserialize-input-props");
|
|
16
18
|
const make_s3_url_1 = require("../shared/make-s3-url");
|
|
17
19
|
const random_hash_1 = require("../shared/random-hash");
|
|
18
20
|
const validate_download_behavior_1 = require("../shared/validate-download-behavior");
|
|
@@ -34,9 +36,9 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
34
36
|
}
|
|
35
37
|
if (lambdaParams.version !== version_1.VERSION) {
|
|
36
38
|
if (!lambdaParams.version) {
|
|
37
|
-
throw new Error(`Version mismatch: When calling renderStillOnLambda(),
|
|
39
|
+
throw new Error(`Version mismatch: When calling renderStillOnLambda(), you called the function ${process.env.AWS_LAMBDA_FUNCTION_NAME} which has the version ${version_1.VERSION} but the @remotion/lambda package is an older version. Deploy a new function and use it to call renderStillOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
38
40
|
}
|
|
39
|
-
throw new Error(`Version mismatch: When calling renderStillOnLambda(),
|
|
41
|
+
throw new Error(`Version mismatch: When calling renderStillOnLambda(), you passed ${process.env.AWS_LAMBDA_FUNCTION_NAME} as the function, which has the version ${version_1.VERSION}, but the @remotion/lambda package you used to invoke the function has version ${lambdaParams.version}. Deploy a new function and use it to call renderStillOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
40
42
|
}
|
|
41
43
|
(0, validate_download_behavior_1.validateDownloadBehavior)(lambdaParams.downloadBehavior);
|
|
42
44
|
(0, validate_privacy_1.validatePrivacy)(lambdaParams.privacy);
|
|
@@ -51,11 +53,17 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
51
53
|
const outputDir = renderer_1.RenderInternals.tmpDir('remotion-render-');
|
|
52
54
|
const outputPath = path_1.default.join(outputDir, 'output');
|
|
53
55
|
const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
|
|
56
|
+
const inputProps = await (0, deserialize_input_props_1.deserializeInputProps)({
|
|
57
|
+
bucketName,
|
|
58
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
59
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
60
|
+
serialized: lambdaParams.inputProps,
|
|
61
|
+
});
|
|
54
62
|
const composition = await (0, validate_composition_1.validateComposition)({
|
|
55
63
|
serveUrl: lambdaParams.serveUrl,
|
|
56
64
|
browserInstance,
|
|
57
65
|
composition: lambdaParams.composition,
|
|
58
|
-
inputProps
|
|
66
|
+
inputProps,
|
|
59
67
|
envVariables: lambdaParams.envVariables,
|
|
60
68
|
ffmpegExecutable: null,
|
|
61
69
|
ffprobeExecutable: null,
|
|
@@ -63,6 +71,8 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
63
71
|
timeoutInMilliseconds: lambdaParams.timeoutInMilliseconds,
|
|
64
72
|
port: null,
|
|
65
73
|
downloadMap,
|
|
74
|
+
forceHeight: lambdaParams.forceHeight,
|
|
75
|
+
forceWidth: lambdaParams.forceWidth,
|
|
66
76
|
});
|
|
67
77
|
const renderMetadata = {
|
|
68
78
|
startedDate: Date.now(),
|
|
@@ -74,7 +84,6 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
74
84
|
siteId: (0, make_s3_url_1.getServeUrlHash)(lambdaParams.serveUrl),
|
|
75
85
|
totalChunks: 1,
|
|
76
86
|
type: 'still',
|
|
77
|
-
usesOptimizationProfile: false,
|
|
78
87
|
imageFormat: lambdaParams.imageFormat,
|
|
79
88
|
inputProps: lambdaParams.inputProps,
|
|
80
89
|
lambdaVersion: version_1.VERSION,
|
|
@@ -106,7 +115,7 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
106
115
|
durationInFrames: composition.durationInFrames,
|
|
107
116
|
}),
|
|
108
117
|
imageFormat: lambdaParams.imageFormat,
|
|
109
|
-
inputProps
|
|
118
|
+
inputProps,
|
|
110
119
|
overwrite: false,
|
|
111
120
|
puppeteerInstance: browserInstance,
|
|
112
121
|
quality: lambdaParams.quality,
|
|
@@ -127,7 +136,14 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
|
|
|
127
136
|
downloadBehavior: lambdaParams.downloadBehavior,
|
|
128
137
|
customCredentials,
|
|
129
138
|
});
|
|
130
|
-
await
|
|
139
|
+
await Promise.all([
|
|
140
|
+
fs_1.default.promises.rm(outputPath, { recursive: true }),
|
|
141
|
+
(0, cleanup_serialized_input_props_1.cleanupSerializedInputProps)({
|
|
142
|
+
bucketName,
|
|
143
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
144
|
+
serialized: lambdaParams.inputProps,
|
|
145
|
+
}),
|
|
146
|
+
]);
|
|
131
147
|
const estimatedPrice = (0, estimate_price_1.estimatePrice)({
|
|
132
148
|
durationInMiliseconds: Date.now() - start + 100,
|
|
133
149
|
memorySizeInMb: Number(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DeleteFunctionInput } from './api/delete-function';
|
|
2
2
|
import { deleteFunction } from './api/delete-function';
|
|
3
|
+
import type { DeleteRenderInput } from './api/delete-render';
|
|
3
4
|
import { deleteRender } from './api/delete-render';
|
|
4
5
|
import type { DeleteSiteInput, DeleteSiteOutput } from './api/delete-site';
|
|
5
6
|
import { deleteSite } from './api/delete-site';
|
|
@@ -13,6 +14,8 @@ import type { EstimatePriceInput } from './api/estimate-price';
|
|
|
13
14
|
import { estimatePrice } from './api/estimate-price';
|
|
14
15
|
import type { GetAwsClientInput, GetAwsClientOutput } from './api/get-aws-client';
|
|
15
16
|
import { getAwsClient } from './api/get-aws-client';
|
|
17
|
+
import type { GetCompositionsOnLambdaInput, GetCompositionsOnLambdaOutput } from './api/get-compositions-on-lambda';
|
|
18
|
+
import { getCompositionsOnLambda } from './api/get-compositions-on-lambda';
|
|
16
19
|
import type { FunctionInfo, GetFunctionInfoInput } from './api/get-function-info';
|
|
17
20
|
import { getFunctionInfo } from './api/get-function-info';
|
|
18
21
|
import type { GetFunctionsInput } from './api/get-functions';
|
|
@@ -34,11 +37,12 @@ import type { RenderStillOnLambdaInput, RenderStillOnLambdaOutput } from './api/
|
|
|
34
37
|
import { renderStillOnLambda } from './api/render-still-on-lambda';
|
|
35
38
|
import { validateWebhookSignature } from './api/validate-webhook-signature';
|
|
36
39
|
import type { LambdaLSInput, LambdaLsReturnType } from './functions/helpers/io';
|
|
40
|
+
import type { EnhancedErrorInfo, LambdaErrorInfo } from './functions/helpers/write-lambda-error';
|
|
37
41
|
import { LambdaInternals } from './internals';
|
|
38
42
|
import type { AwsRegion } from './pricing/aws-regions';
|
|
39
43
|
import type { CustomCredentials } from './shared/aws-clients';
|
|
40
44
|
import type { RenderProgress } from './shared/constants';
|
|
41
45
|
import type { WebhookPayload } from './shared/invoke-webhook';
|
|
42
46
|
import type { LambdaArchitecture } from './shared/validate-architecture';
|
|
43
|
-
export { deleteSite, deployFunction, deploySite, downloadMedia, downloadVideo, getFunctions, getUserPolicy, getRolePolicy, getSites, getOrCreateBucket, getRenderProgress, renderVideoOnLambda, renderMediaOnLambda, simulatePermissions, deleteFunction, getFunctionInfo, estimatePrice, LambdaInternals, renderStillOnLambda, getRegions, getAwsClient, presignUrl, deleteRender, validateWebhookSignature, };
|
|
44
|
-
export type { AwsRegion, RenderProgress, DeploySiteInput, DeploySiteOutput, LambdaLsReturnType, LambdaLSInput, DeleteSiteInput, DeleteSiteOutput, EstimatePriceInput, DeployFunctionInput, DeployFunctionOutput, DeleteFunctionInput, GetFunctionInfoInput, FunctionInfo, GetFunctionsInput, GetSitesInput, GetSitesOutput, DownloadMediaInput, DownloadMediaOutput, GetOrCreateBucketInput, GetOrCreateBucketOutput, GetRenderInput, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, RenderStillOnLambdaInput, RenderStillOnLambdaOutput, SimulatePermissionsInput, SimulatePermissionsOutput, GetAwsClientInput, GetAwsClientOutput, LambdaArchitecture, CustomCredentials, WebhookPayload, };
|
|
47
|
+
export { deleteSite, deployFunction, deploySite, downloadMedia, downloadVideo, getFunctions, getUserPolicy, getRolePolicy, getSites, getOrCreateBucket, getRenderProgress, renderVideoOnLambda, renderMediaOnLambda, simulatePermissions, deleteFunction, getFunctionInfo, estimatePrice, LambdaInternals, renderStillOnLambda, getRegions, getAwsClient, presignUrl, deleteRender, validateWebhookSignature, getCompositionsOnLambda, };
|
|
48
|
+
export type { AwsRegion, RenderProgress, DeploySiteInput, DeploySiteOutput, LambdaLsReturnType, LambdaLSInput, DeleteSiteInput, DeleteSiteOutput, EstimatePriceInput, DeployFunctionInput, DeployFunctionOutput, DeleteFunctionInput, GetFunctionInfoInput, FunctionInfo, GetFunctionsInput, GetSitesInput, GetSitesOutput, DownloadMediaInput, DownloadMediaOutput, GetOrCreateBucketInput, GetOrCreateBucketOutput, GetRenderInput, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, RenderStillOnLambdaInput, RenderStillOnLambdaOutput, SimulatePermissionsInput, SimulatePermissionsOutput, GetAwsClientInput, GetAwsClientOutput, LambdaArchitecture, CustomCredentials, WebhookPayload, LambdaErrorInfo, EnhancedErrorInfo, DeleteRenderInput, GetCompositionsOnLambdaOutput, GetCompositionsOnLambdaInput, };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateWebhookSignature = exports.deleteRender = exports.presignUrl = exports.getAwsClient = exports.getRegions = exports.renderStillOnLambda = exports.LambdaInternals = exports.estimatePrice = exports.getFunctionInfo = exports.deleteFunction = exports.simulatePermissions = exports.renderMediaOnLambda = exports.renderVideoOnLambda = exports.getRenderProgress = exports.getOrCreateBucket = exports.getSites = exports.getRolePolicy = exports.getUserPolicy = exports.getFunctions = exports.downloadVideo = exports.downloadMedia = exports.deploySite = exports.deployFunction = exports.deleteSite = void 0;
|
|
3
|
+
exports.getCompositionsOnLambda = exports.validateWebhookSignature = exports.deleteRender = exports.presignUrl = exports.getAwsClient = exports.getRegions = exports.renderStillOnLambda = exports.LambdaInternals = exports.estimatePrice = exports.getFunctionInfo = exports.deleteFunction = exports.simulatePermissions = exports.renderMediaOnLambda = exports.renderVideoOnLambda = exports.getRenderProgress = exports.getOrCreateBucket = exports.getSites = exports.getRolePolicy = exports.getUserPolicy = exports.getFunctions = exports.downloadVideo = exports.downloadMedia = exports.deploySite = exports.deployFunction = exports.deleteSite = void 0;
|
|
4
4
|
const delete_function_1 = require("./api/delete-function");
|
|
5
5
|
Object.defineProperty(exports, "deleteFunction", { enumerable: true, get: function () { return delete_function_1.deleteFunction; } });
|
|
6
6
|
const delete_render_1 = require("./api/delete-render");
|
|
@@ -18,6 +18,8 @@ const estimate_price_1 = require("./api/estimate-price");
|
|
|
18
18
|
Object.defineProperty(exports, "estimatePrice", { enumerable: true, get: function () { return estimate_price_1.estimatePrice; } });
|
|
19
19
|
const get_aws_client_1 = require("./api/get-aws-client");
|
|
20
20
|
Object.defineProperty(exports, "getAwsClient", { enumerable: true, get: function () { return get_aws_client_1.getAwsClient; } });
|
|
21
|
+
const get_compositions_on_lambda_1 = require("./api/get-compositions-on-lambda");
|
|
22
|
+
Object.defineProperty(exports, "getCompositionsOnLambda", { enumerable: true, get: function () { return get_compositions_on_lambda_1.getCompositionsOnLambda; } });
|
|
21
23
|
const get_function_info_1 = require("./api/get-function-info");
|
|
22
24
|
Object.defineProperty(exports, "getFunctionInfo", { enumerable: true, get: function () { return get_function_info_1.getFunctionInfo; } });
|
|
23
25
|
const get_functions_1 = require("./api/get-functions");
|
package/dist/internals.d.ts
CHANGED
package/dist/internals.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/regions.d.ts
CHANGED
|
File without changes
|
package/dist/regions.js
CHANGED
|
File without changes
|
package/dist/shared/await.d.ts
CHANGED
|
File without changes
|
package/dist/shared/await.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AwsRegion } from '../client';
|
|
2
|
+
import type { SerializedInputProps } from './constants';
|
|
3
|
+
export declare const cleanupSerializedInputProps: ({ serialized, region, bucketName, }: {
|
|
4
|
+
serialized: SerializedInputProps;
|
|
5
|
+
region: AwsRegion;
|
|
6
|
+
bucketName: string;
|
|
7
|
+
}) => Promise<number>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cleanupSerializedInputProps = void 0;
|
|
4
|
+
const io_1 = require("../functions/helpers/io");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
const cleanupSerializedInputProps = async ({ serialized, region, bucketName, }) => {
|
|
7
|
+
if (serialized.type === 'payload') {
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
const time = Date.now();
|
|
11
|
+
await (0, io_1.lambdaDeleteFile)({
|
|
12
|
+
bucketName,
|
|
13
|
+
key: (0, constants_1.inputPropsKey)(serialized.hash),
|
|
14
|
+
region,
|
|
15
|
+
customCredentials: null,
|
|
16
|
+
});
|
|
17
|
+
return Date.now() - time;
|
|
18
|
+
};
|
|
19
|
+
exports.cleanupSerializedInputProps = cleanupSerializedInputProps;
|