@remotion/lambda 4.0.0-webhook.26 → 4.1.0-alpha2
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 +24 -13
- package/dist/admin/generate-etag-list.d.ts +1 -0
- package/dist/admin/generate-etag-list.js +14 -0
- package/dist/admin/make-layer-public.d.ts +0 -0
- package/dist/admin/make-layer-public.js +59 -65
- 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 +1 -1
- package/dist/api/create-bucket.d.ts +0 -0
- package/dist/api/create-bucket.js +34 -1
- package/dist/api/create-function.d.ts +1 -3
- package/dist/api/create-function.js +27 -6
- package/dist/api/delete-function.d.ts +4 -4
- package/dist/api/delete-function.js +3 -3
- package/dist/api/delete-render.d.ts +2 -2
- package/dist/api/delete-render.js +1 -1
- package/dist/api/delete-site.d.ts +7 -7
- package/dist/api/delete-site.js +9 -7
- package/dist/api/deploy-function.d.ts +11 -13
- package/dist/api/deploy-function.js +28 -31
- package/dist/api/deploy-site.d.ts +13 -5
- package/dist/api/deploy-site.js +61 -25
- package/dist/api/download-media.d.ts +4 -8
- package/dist/api/download-media.js +5 -9
- package/dist/api/estimate-price.d.ts +3 -5
- package/dist/api/estimate-price.js +4 -10
- package/dist/api/get-aws-client.d.ts +6 -4
- package/dist/api/get-aws-client.js +3 -1
- package/dist/api/get-buckets.d.ts +1 -1
- package/dist/api/get-buckets.js +26 -9
- package/dist/api/get-compositions-on-lambda.d.ts +31 -0
- package/dist/api/get-compositions-on-lambda.js +56 -0
- package/dist/api/get-function-info.d.ts +3 -3
- package/dist/api/get-function-info.js +1 -1
- package/dist/api/get-functions.d.ts +5 -7
- package/dist/api/get-functions.js +8 -10
- package/dist/api/get-or-create-bucket.d.ts +6 -6
- package/dist/api/get-or-create-bucket.js +10 -18
- package/dist/api/get-regions.d.ts +6 -2
- package/dist/api/get-regions.js +6 -3
- package/dist/api/get-render-progress.d.ts +3 -3
- package/dist/api/get-render-progress.js +6 -11
- package/dist/api/get-sites.d.ts +4 -5
- package/dist/api/get-sites.js +1 -2
- 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 +2 -2
- package/dist/api/iam-validation/simulate-rule.js +0 -22
- package/dist/api/iam-validation/simulate.d.ts +3 -3
- package/dist/api/iam-validation/simulate.js +27 -6
- 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 +1 -1
- package/dist/api/iam-validation/user-permissions.js +3 -8
- package/dist/api/make-lambda-payload.d.ts +5 -0
- package/dist/api/make-lambda-payload.js +77 -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 +4 -5
- package/dist/api/presign-url.js +3 -3
- package/dist/api/render-media-on-lambda.d.ts +25 -11
- package/dist/api/render-media-on-lambda.js +16 -49
- package/dist/api/render-still-on-lambda.d.ts +15 -6
- package/dist/api/render-still-on-lambda.js +23 -9
- package/dist/api/speculate-function-name.d.ts +14 -0
- package/dist/api/speculate-function-name.js +22 -0
- package/dist/api/upload-dir.d.ts +6 -5
- package/dist/api/upload-dir.js +54 -51
- package/dist/api/validate-webhook-signature.d.ts +2 -2
- package/dist/api/validate-webhook-signature.js +1 -1
- package/dist/cli/args.d.ts +7 -5
- 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 +15 -15
- package/dist/cli/commands/functions/index.d.ts +0 -0
- package/dist/cli/commands/functions/index.js +16 -17
- package/dist/cli/commands/functions/ls.d.ts +0 -0
- package/dist/cli/commands/functions/ls.js +17 -10
- package/dist/cli/commands/functions/rm.d.ts +0 -0
- package/dist/cli/commands/functions/rm.js +20 -7
- package/dist/cli/commands/functions/rmall.d.ts +0 -0
- package/dist/cli/commands/functions/rmall.js +20 -8
- 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 +30 -10
- package/dist/cli/commands/quotas/index.d.ts +0 -0
- package/dist/cli/commands/quotas/index.js +8 -9
- 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 +6 -2
- package/dist/cli/commands/render/progress.d.ts +11 -7
- package/dist/cli/commands/render/progress.js +55 -45
- package/dist/cli/commands/render/render.d.ts +1 -1
- package/dist/cli/commands/render/render.js +99 -27
- package/dist/cli/commands/sites/create.d.ts +1 -1
- package/dist/cli/commands/sites/create.js +36 -33
- package/dist/cli/commands/sites/index.d.ts +1 -1
- package/dist/cli/commands/sites/index.js +18 -16
- package/dist/cli/commands/sites/ls.d.ts +0 -0
- package/dist/cli/commands/sites/ls.js +9 -10
- package/dist/cli/commands/sites/rm.d.ts +0 -0
- package/dist/cli/commands/sites/rm.js +6 -16
- package/dist/cli/commands/sites/rmall.d.ts +0 -0
- package/dist/cli/commands/sites/rmall.js +5 -16
- package/dist/cli/commands/still.d.ts +1 -1
- package/dist/cli/commands/still.js +49 -20
- 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 +4 -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 +35 -6
- package/dist/cli/helpers/progress-bar.d.ts +12 -7
- package/dist/cli/helpers/progress-bar.js +20 -11
- 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 +23 -12
- package/dist/cli/is-cli.d.ts +0 -0
- package/dist/cli/is-cli.js +0 -0
- package/dist/cli/log.d.ts +15 -0
- package/dist/cli/log.js +0 -0
- package/dist/client.d.ts +8 -2
- package/dist/client.js +9 -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 +2 -15
- package/dist/functions/chunk-optimization/types.d.ts +2 -13
- package/dist/functions/chunk-optimization/types.js +0 -0
- package/dist/functions/compositions.d.ts +8 -0
- package/dist/functions/compositions.js +60 -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 +1 -3
- package/dist/functions/helpers/calculate-price-from-bucket.js +1 -2
- 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 +8 -8
- package/dist/functions/helpers/concat-videos.d.ts +13 -5
- package/dist/functions/helpers/concat-videos.js +38 -39
- package/dist/functions/helpers/create-post-render-data.d.ts +0 -0
- package/dist/functions/helpers/create-post-render-data.js +1 -15
- 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 +2 -2
- package/dist/functions/helpers/find-output-file-in-bucket.d.ts +1 -1
- 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 +1 -2
- package/dist/functions/helpers/get-browser-instance.js +7 -3
- package/dist/functions/helpers/get-chromium-executable-path.d.ts +1 -1
- package/dist/functions/helpers/get-chromium-executable-path.js +8 -6
- 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-region.d.ts +1 -1
- 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 +5 -8
- package/dist/functions/helpers/get-encoding-metadata.js +7 -17
- package/dist/functions/helpers/get-files-in-folder.d.ts +1 -1
- package/dist/functions/helpers/get-files-in-folder.js +5 -5
- package/dist/functions/helpers/get-files-to-delete.d.ts +1 -1
- package/dist/functions/helpers/get-files-to-delete.js +0 -0
- package/dist/functions/helpers/get-final-encoding-status.d.ts +2 -4
- package/dist/functions/helpers/get-final-encoding-status.js +1 -4
- 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 +2 -6
- package/dist/functions/helpers/get-lambdas-invoked-stats.js +1 -9
- 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 +2 -1
- package/dist/functions/helpers/get-overall-progress.js +7 -5
- 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 +43 -42
- 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-rendered-frames-progress.d.ts +8 -0
- package/dist/functions/helpers/get-rendered-frames-progress.js +37 -0
- package/dist/functions/helpers/get-retry-stats.d.ts +1 -1
- 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 +10 -4
- package/dist/functions/helpers/io.js +25 -3
- package/dist/functions/helpers/is-enosp-err.d.ts +0 -0
- package/dist/functions/helpers/is-enosp-err.js +1 -1
- package/dist/functions/helpers/is-warm.d.ts +0 -0
- package/dist/functions/helpers/is-warm.js +0 -0
- package/dist/functions/helpers/make-timeout-error.d.ts +8 -0
- package/dist/functions/helpers/make-timeout-error.js +35 -0
- package/dist/functions/helpers/make-timeout-message.d.ts +6 -0
- package/dist/functions/helpers/make-timeout-message.js +31 -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 +1 -1
- package/dist/functions/helpers/read-with-progress.js +1 -1
- package/dist/functions/helpers/streamify-response.d.ts +16 -0
- package/dist/functions/helpers/streamify-response.js +67 -0
- 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 +10 -9
- package/dist/functions/helpers/validate-composition.js +16 -13
- package/dist/functions/helpers/write-lambda-error.d.ts +2 -2
- 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 +1 -7
- package/dist/functions/index.js +43 -10
- package/dist/functions/info.d.ts +0 -0
- package/dist/functions/info.js +0 -0
- package/dist/functions/launch.d.ts +2 -1
- package/dist/functions/launch.js +152 -134
- package/dist/functions/progress.d.ts +1 -1
- package/dist/functions/progress.js +2 -2
- package/dist/functions/renderer.d.ts +1 -1
- package/dist/functions/renderer.js +73 -42
- package/dist/functions/start.d.ts +1 -1
- package/dist/functions/start.js +22 -8
- package/dist/functions/still.d.ts +1 -1
- package/dist/functions/still.js +80 -37
- package/dist/index.d.ts +24 -8
- package/dist/index.js +23 -6
- package/dist/internals.d.ts +3 -1
- package/dist/internals.js +3 -0
- package/dist/pricing/aws-regions.d.ts +3 -2
- package/dist/pricing/aws-regions.js +31 -1
- package/dist/pricing/price-per-1-s.d.ts +0 -0
- package/dist/pricing/price-per-1-s.js +413 -39
- package/dist/regions.d.ts +0 -0
- package/dist/regions.js +0 -0
- package/dist/shared/await.d.ts +1 -1
- package/dist/shared/await.js +0 -0
- package/dist/shared/aws-clients.d.ts +6 -3
- package/dist/shared/aws-clients.js +75 -13
- 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 +27 -2
- package/dist/shared/check-credentials.d.ts +0 -0
- package/dist/shared/check-credentials.js +3 -0
- package/dist/shared/chunk-progress.d.ts +9 -0
- package/dist/shared/chunk-progress.js +2034 -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 +140 -89
- package/dist/shared/constants.js +7 -4
- package/dist/shared/content-disposition-header.d.ts +1 -1
- package/dist/shared/content-disposition-header.js +0 -0
- package/dist/shared/convert-to-serve-url.d.ts +5 -1
- package/dist/shared/convert-to-serve-url.js +1 -5
- 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 +1 -1
- package/dist/shared/function-zip-path.js +3 -3
- package/dist/shared/get-account-id.d.ts +0 -0
- package/dist/shared/get-account-id.js +4 -6
- package/dist/shared/{get-cloudwatch-stream-url.d.ts → get-aws-urls.d.ts} +7 -1
- package/dist/shared/get-aws-urls.js +12 -0
- package/dist/shared/get-etag.d.ts +1 -0
- package/dist/shared/get-etag.js +24 -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 +2 -2
- package/dist/shared/get-most-expensive-chunks.js +3 -2
- package/dist/shared/get-s3-operations.d.ts +10 -0
- package/dist/shared/get-s3-operations.js +36 -0
- package/dist/shared/hosted-layers.d.ts +5 -8
- package/dist/shared/hosted-layers.js +210 -284
- package/dist/shared/invoke-webhook.d.ts +5 -18
- package/dist/shared/invoke-webhook.js +5 -19
- 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 +2 -2
- package/dist/shared/make-s3-url.d.ts +0 -0
- package/dist/shared/make-s3-url.js +2 -2
- package/dist/shared/p-limit.d.ts +0 -0
- package/dist/shared/p-limit.js +0 -0
- package/dist/shared/parse-chunk-key.d.ts +4 -0
- package/dist/shared/parse-chunk-key.js +14 -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 +1 -1
- 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/read-dir.d.ts +9 -0
- package/dist/shared/read-dir.js +57 -0
- package/dist/shared/return-values.d.ts +7 -0
- package/dist/shared/return-values.js +0 -0
- package/dist/shared/serialize-input-props.d.ts +8 -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 +1 -1
- package/dist/shared/truthy.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 +5 -0
- package/dist/shared/validate-bucketname.js +19 -1
- 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 +2 -2
- package/dist/shared/validate-lambda-codec.js +1 -1
- 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 +2 -2
- package/dist/shared/validate-outname.js +16 -10
- 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 +1 -1
- package/dist/shared/validate-privacy.js +5 -2
- 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 +89 -65
- package/remotionlambda-arm64.zip +0 -0
- package/.prettierrc.js +0 -14
- package/client.d.ts +0 -1
- package/client.js +0 -1
- package/dist/api/enable-s3-website.d.ts +0 -5
- package/dist/api/enable-s3-website.js +0 -16
- 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/get-cloudwatch-stream-url.js +0 -7
- 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/helpers/get-current-architecture.d.ts +0 -2
- package/dist/functions/helpers/get-current-architecture.js +0 -11
- package/dist/shared/get-cloudwatch-stream-url.js +0 -7
- package/dist/shared/validate-architecture.d.ts +0 -4
- package/dist/shared/validate-architecture.js +0 -14
- package/remotionlambda.zip +0 -0
- package/tsconfig.json +0 -16
package/dist/client.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateWebhookSignature = exports.getFunctions = exports.getRenderProgress = exports.renderStillOnLambda = exports.renderMediaOnLambda = exports.renderVideoOnLambda = void 0;
|
|
3
|
+
exports.speculateFunctionName = exports.getSites = exports.presignUrl = exports.getCompositionsOnLambda = exports.validateWebhookSignature = exports.getFunctions = exports.getRenderProgress = exports.renderStillOnLambda = exports.renderMediaOnLambda = exports.renderVideoOnLambda = void 0;
|
|
4
|
+
const get_compositions_on_lambda_1 = require("./api/get-compositions-on-lambda");
|
|
5
|
+
Object.defineProperty(exports, "getCompositionsOnLambda", { enumerable: true, get: function () { return get_compositions_on_lambda_1.getCompositionsOnLambda; } });
|
|
4
6
|
const get_functions_1 = require("./api/get-functions");
|
|
5
7
|
Object.defineProperty(exports, "getFunctions", { enumerable: true, get: function () { return get_functions_1.getFunctions; } });
|
|
6
8
|
const get_render_progress_1 = require("./api/get-render-progress");
|
|
7
9
|
Object.defineProperty(exports, "getRenderProgress", { enumerable: true, get: function () { return get_render_progress_1.getRenderProgress; } });
|
|
10
|
+
const get_sites_1 = require("./api/get-sites");
|
|
11
|
+
Object.defineProperty(exports, "getSites", { enumerable: true, get: function () { return get_sites_1.getSites; } });
|
|
12
|
+
const presign_url_1 = require("./api/presign-url");
|
|
13
|
+
Object.defineProperty(exports, "presignUrl", { enumerable: true, get: function () { return presign_url_1.presignUrl; } });
|
|
8
14
|
const render_media_on_lambda_1 = require("./api/render-media-on-lambda");
|
|
9
15
|
Object.defineProperty(exports, "renderMediaOnLambda", { enumerable: true, get: function () { return render_media_on_lambda_1.renderMediaOnLambda; } });
|
|
10
16
|
Object.defineProperty(exports, "renderVideoOnLambda", { enumerable: true, get: function () { return render_media_on_lambda_1.renderVideoOnLambda; } });
|
|
11
17
|
const render_still_on_lambda_1 = require("./api/render-still-on-lambda");
|
|
12
18
|
Object.defineProperty(exports, "renderStillOnLambda", { enumerable: true, get: function () { return render_still_on_lambda_1.renderStillOnLambda; } });
|
|
19
|
+
const speculate_function_name_1 = require("./api/speculate-function-name");
|
|
20
|
+
Object.defineProperty(exports, "speculateFunctionName", { enumerable: true, get: function () { return speculate_function_name_1.speculateFunctionName; } });
|
|
13
21
|
const validate_webhook_signature_1 = require("./api/validate-webhook-signature");
|
|
14
22
|
Object.defineProperty(exports, "validateWebhookSignature", { enumerable: true, get: function () { return validate_webhook_signature_1.validateWebhookSignature; } });
|
package/dist/defaults.d.ts
CHANGED
|
File without changes
|
package/dist/defaults.js
CHANGED
|
File without changes
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const planFrameRanges: ({ framesPerLambda, optimization, shouldUseOptimization, frameRange, everyNthFrame, }: {
|
|
1
|
+
export declare const planFrameRanges: ({ framesPerLambda, frameRange, everyNthFrame, }: {
|
|
3
2
|
framesPerLambda: number;
|
|
4
|
-
optimization: OptimizationProfile | null;
|
|
5
|
-
shouldUseOptimization: boolean;
|
|
6
3
|
frameRange: [number, number];
|
|
7
4
|
everyNthFrame: number;
|
|
8
5
|
}) => {
|
|
9
6
|
chunks: [number, number][];
|
|
10
|
-
didUseOptimization: boolean;
|
|
11
7
|
};
|
|
@@ -2,29 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.planFrameRanges = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
const
|
|
6
|
-
const planFrameRanges = ({ framesPerLambda, optimization, shouldUseOptimization, frameRange, everyNthFrame, }) => {
|
|
5
|
+
const planFrameRanges = ({ framesPerLambda, frameRange, everyNthFrame, }) => {
|
|
7
6
|
const framesToRender = renderer_1.RenderInternals.getFramesToRender(frameRange, everyNthFrame);
|
|
8
7
|
const chunkCount = Math.ceil(framesToRender.length / framesPerLambda);
|
|
9
|
-
if ((0, can_use_optimization_1.canUseOptimization)({
|
|
10
|
-
optimization,
|
|
11
|
-
framesPerLambda,
|
|
12
|
-
frameRange,
|
|
13
|
-
}) &&
|
|
14
|
-
shouldUseOptimization) {
|
|
15
|
-
return {
|
|
16
|
-
chunks: optimization.ranges,
|
|
17
|
-
didUseOptimization: true,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
8
|
const firstFrame = frameRange[0];
|
|
21
9
|
return {
|
|
22
10
|
chunks: new Array(chunkCount).fill(1).map((_, i) => {
|
|
23
11
|
const start = i * framesPerLambda * everyNthFrame + firstFrame;
|
|
24
|
-
const end = Math.min(framesToRender[framesToRender.length - 1], (i + 1) * framesPerLambda * everyNthFrame - 1
|
|
12
|
+
const end = Math.min(framesToRender[framesToRender.length - 1], (i + 1) * framesPerLambda * everyNthFrame - 1 + firstFrame);
|
|
25
13
|
return [start, end];
|
|
26
14
|
}),
|
|
27
|
-
didUseOptimization: false,
|
|
28
15
|
};
|
|
29
16
|
};
|
|
30
17
|
exports.planFrameRanges = planFrameRanges;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ObjectChunkTimingData = {
|
|
2
2
|
chunk: number;
|
|
3
3
|
frameRange: [number, number];
|
|
4
4
|
startDate: number;
|
|
@@ -6,17 +6,6 @@ export declare type ObjectChunkTimingData = {
|
|
|
6
6
|
[key: number]: number;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type ChunkTimingData = Omit<ObjectChunkTimingData, 'timings'> & {
|
|
10
10
|
timings: number[];
|
|
11
11
|
};
|
|
12
|
-
export declare type TimingProfile = ChunkTimingData[];
|
|
13
|
-
export declare type OptimizationProfile = {
|
|
14
|
-
ranges: [number, number][];
|
|
15
|
-
frameRange: [number, number];
|
|
16
|
-
oldTiming: number;
|
|
17
|
-
newTiming: number;
|
|
18
|
-
createdFromRenderId: string;
|
|
19
|
-
framesPerLambda: number;
|
|
20
|
-
lambdaVersion: string;
|
|
21
|
-
everyNthFrame: number;
|
|
22
|
-
};
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LambdaPayload } from '../defaults';
|
|
2
|
+
type Options = {
|
|
3
|
+
expectedBucketOwner: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const compositionsHandler: (lambdaParams: LambdaPayload, options: Options) => Promise<{
|
|
6
|
+
compositions: import("remotion").AnyCompMetadata[];
|
|
7
|
+
}>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compositionsHandler = void 0;
|
|
4
|
+
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
const version_1 = require("remotion/version");
|
|
6
|
+
const get_or_create_bucket_1 = require("../api/get-or-create-bucket");
|
|
7
|
+
const defaults_1 = require("../defaults");
|
|
8
|
+
const convert_to_serve_url_1 = require("../shared/convert-to-serve-url");
|
|
9
|
+
const deserialize_input_props_1 = require("../shared/deserialize-input-props");
|
|
10
|
+
const get_browser_instance_1 = require("./helpers/get-browser-instance");
|
|
11
|
+
const get_current_region_1 = require("./helpers/get-current-region");
|
|
12
|
+
const compositionsHandler = async (lambdaParams, options) => {
|
|
13
|
+
var _a, _b, _c, _d;
|
|
14
|
+
if (lambdaParams.type !== defaults_1.LambdaRoutines.compositions) {
|
|
15
|
+
throw new TypeError('Expected info compositions');
|
|
16
|
+
}
|
|
17
|
+
if (lambdaParams.version !== version_1.VERSION) {
|
|
18
|
+
if (!lambdaParams.version) {
|
|
19
|
+
throw new Error(`Version mismatch: When calling getCompositionsOnLambda(), 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 getCompositionsOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
20
|
+
}
|
|
21
|
+
throw new Error(`Version mismatch: When calling getCompositionsOnLambda(), 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 getCompositionsOnLambda(). See: https://www.remotion.dev/docs/lambda/upgrading`);
|
|
22
|
+
}
|
|
23
|
+
const region = (0, get_current_region_1.getCurrentRegionInFunction)();
|
|
24
|
+
const verbose = renderer_1.RenderInternals.isEqualOrBelowLogLevel(lambdaParams.logLevel, 'verbose');
|
|
25
|
+
const [bucketName, browserInstance] = await Promise.all([
|
|
26
|
+
(_a = lambdaParams.bucketName) !== null && _a !== void 0 ? _a : (0, get_or_create_bucket_1.getOrCreateBucket)({
|
|
27
|
+
region,
|
|
28
|
+
}).then((b) => b.bucketName),
|
|
29
|
+
(0, get_browser_instance_1.getBrowserInstance)((_b = lambdaParams.dumpBrowserLogs) !== null && _b !== void 0 ? _b : verbose, (_c = lambdaParams.chromiumOptions) !== null && _c !== void 0 ? _c : {}),
|
|
30
|
+
]);
|
|
31
|
+
const inputProps = await (0, deserialize_input_props_1.deserializeInputProps)({
|
|
32
|
+
bucketName,
|
|
33
|
+
expectedBucketOwner: options.expectedBucketOwner,
|
|
34
|
+
region: (0, get_current_region_1.getCurrentRegionInFunction)(),
|
|
35
|
+
serialized: lambdaParams.inputProps,
|
|
36
|
+
});
|
|
37
|
+
const realServeUrl = (0, convert_to_serve_url_1.convertToServeUrl)({
|
|
38
|
+
urlOrId: lambdaParams.serveUrl,
|
|
39
|
+
region,
|
|
40
|
+
bucketName,
|
|
41
|
+
});
|
|
42
|
+
const compositions = await renderer_1.RenderInternals.internalGetCompositions({
|
|
43
|
+
serveUrlOrWebpackUrl: realServeUrl,
|
|
44
|
+
puppeteerInstance: browserInstance,
|
|
45
|
+
inputProps,
|
|
46
|
+
envVariables: (_d = lambdaParams.envVariables) !== null && _d !== void 0 ? _d : {},
|
|
47
|
+
timeoutInMilliseconds: lambdaParams.timeoutInMilliseconds,
|
|
48
|
+
chromiumOptions: lambdaParams.chromiumOptions,
|
|
49
|
+
port: null,
|
|
50
|
+
server: undefined,
|
|
51
|
+
verbose,
|
|
52
|
+
indent: false,
|
|
53
|
+
browserExecutable: null,
|
|
54
|
+
onBrowserLog: null,
|
|
55
|
+
});
|
|
56
|
+
return Promise.resolve({
|
|
57
|
+
compositions,
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
exports.compositionsHandler = compositionsHandler;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { _Object } from '@aws-sdk/client-s3';
|
|
2
2
|
import type { RenderMetadata } from '../../shared/constants';
|
|
3
|
-
import type { LambdaArchitecture } from '../../shared/validate-architecture';
|
|
4
3
|
import type { OutputFileMetadata } from './find-output-file-in-bucket';
|
|
5
|
-
export declare const estimatePriceFromBucket: ({ contents, renderMetadata, memorySizeInMb, outputFileMetadata,
|
|
4
|
+
export declare const estimatePriceFromBucket: ({ contents, renderMetadata, memorySizeInMb, outputFileMetadata, diskSizeInMb, lambdasInvoked, }: {
|
|
6
5
|
contents: _Object[];
|
|
7
6
|
renderMetadata: RenderMetadata | null;
|
|
8
7
|
memorySizeInMb: number;
|
|
9
8
|
outputFileMetadata: OutputFileMetadata | null;
|
|
10
|
-
architecture: LambdaArchitecture;
|
|
11
9
|
diskSizeInMb: number;
|
|
12
10
|
lambdasInvoked: number;
|
|
13
11
|
}) => number | null;
|
|
@@ -7,7 +7,7 @@ const parse_lambda_timings_key_1 = require("../../shared/parse-lambda-timings-ke
|
|
|
7
7
|
const calculate_chunk_times_1 = require("./calculate-chunk-times");
|
|
8
8
|
const get_current_region_1 = require("./get-current-region");
|
|
9
9
|
const get_time_to_finish_1 = require("./get-time-to-finish");
|
|
10
|
-
const estimatePriceFromBucket = ({ contents, renderMetadata, memorySizeInMb, outputFileMetadata,
|
|
10
|
+
const estimatePriceFromBucket = ({ contents, renderMetadata, memorySizeInMb, outputFileMetadata, diskSizeInMb, lambdasInvoked, }) => {
|
|
11
11
|
var _a, _b, _c;
|
|
12
12
|
if (!renderMetadata) {
|
|
13
13
|
return null;
|
|
@@ -35,7 +35,6 @@ const estimatePriceFromBucket = ({ contents, renderMetadata, memorySizeInMb, out
|
|
|
35
35
|
type: 'combined-time-for-cost-calculation',
|
|
36
36
|
}) + timeElapsedOfUnfinished,
|
|
37
37
|
memorySizeInMb,
|
|
38
|
-
architecture,
|
|
39
38
|
diskSizeInMb,
|
|
40
39
|
lambdasInvoked,
|
|
41
40
|
}).toPrecision(5));
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -4,21 +4,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.deleteTmpDir = exports.deletedFilesSize = exports.deletedFiles = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
9
|
exports.deletedFiles = [];
|
|
10
10
|
exports.deletedFilesSize = 0;
|
|
11
11
|
const deleteAllFilesInAFolderRecursively = (path) => {
|
|
12
|
-
const files =
|
|
12
|
+
const files = node_fs_1.default.readdirSync(path);
|
|
13
13
|
files.forEach((file) => {
|
|
14
|
-
const filePath = (0,
|
|
14
|
+
const filePath = (0, node_path_1.join)(path, file);
|
|
15
15
|
try {
|
|
16
|
-
const stat =
|
|
16
|
+
const stat = node_fs_1.default.statSync(filePath);
|
|
17
17
|
if (stat.isDirectory()) {
|
|
18
18
|
deleteAllFilesInAFolderRecursively(filePath);
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
21
|
-
|
|
21
|
+
node_fs_1.default.unlinkSync(filePath);
|
|
22
22
|
exports.deletedFilesSize += stat.size;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -29,13 +29,13 @@ const deleteAllFilesInAFolderRecursively = (path) => {
|
|
|
29
29
|
exports.deletedFiles.push(filePath);
|
|
30
30
|
});
|
|
31
31
|
if (path !== '/tmp') {
|
|
32
|
-
|
|
32
|
+
node_fs_1.default.rmSync(path, { recursive: true, force: true });
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
const deleteTmpDir = () => {
|
|
36
36
|
exports.deletedFiles = [];
|
|
37
37
|
exports.deletedFilesSize = 0;
|
|
38
|
-
if (
|
|
38
|
+
if (!process.env.VITEST) {
|
|
39
39
|
deleteAllFilesInAFolderRecursively('/tmp');
|
|
40
40
|
}
|
|
41
41
|
};
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
+
import type { AudioCodec } from '@remotion/renderer';
|
|
1
2
|
import type { AwsRegion } from '../../pricing/aws-regions';
|
|
2
3
|
import type { LambdaCodec } from '../../shared/validate-lambda-codec';
|
|
3
|
-
|
|
4
|
+
import type { EnhancedErrorInfo } from './write-lambda-error';
|
|
5
|
+
export declare const getAllFilesS3: ({ bucket, expectedFiles, outdir, renderId, region, expectedBucketOwner, onErrors, }: {
|
|
4
6
|
bucket: string;
|
|
5
7
|
expectedFiles: number;
|
|
6
|
-
|
|
7
|
-
numberOfFrames: number;
|
|
8
|
+
outdir: string;
|
|
8
9
|
renderId: string;
|
|
9
10
|
region: AwsRegion;
|
|
10
|
-
codec: LambdaCodec;
|
|
11
11
|
expectedBucketOwner: string;
|
|
12
|
+
onErrors: (errors: EnhancedErrorInfo[]) => Promise<void>;
|
|
13
|
+
}) => Promise<string[]>;
|
|
14
|
+
export declare const concatVideosS3: ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, }: {
|
|
15
|
+
onProgress: (frames: number) => void;
|
|
16
|
+
numberOfFrames: number;
|
|
17
|
+
codec: LambdaCodec;
|
|
12
18
|
fps: number;
|
|
13
19
|
numberOfGifLoops: number | null;
|
|
20
|
+
files: string[];
|
|
21
|
+
outdir: string;
|
|
22
|
+
audioCodec: AudioCodec | null;
|
|
14
23
|
}) => Promise<{
|
|
15
24
|
outfile: string;
|
|
16
25
|
cleanupChunksProm: Promise<void>;
|
|
17
|
-
encodingStart: number;
|
|
18
26
|
}>;
|
|
@@ -23,15 +23,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.concatVideosS3 = void 0;
|
|
26
|
+
exports.concatVideosS3 = exports.getAllFilesS3 = void 0;
|
|
27
27
|
const renderer_1 = require("@remotion/renderer");
|
|
28
|
-
const
|
|
29
|
-
const
|
|
28
|
+
const node_fs_1 = __importStar(require("node:fs"));
|
|
29
|
+
const node_path_1 = __importStar(require("node:path"));
|
|
30
30
|
const constants_1 = require("../../shared/constants");
|
|
31
|
+
const inspect_errors_1 = require("./inspect-errors");
|
|
31
32
|
const io_1 = require("./io");
|
|
32
33
|
const timer_1 = require("./timer");
|
|
33
34
|
const getChunkDownloadOutputLocation = ({ outdir, file, }) => {
|
|
34
|
-
return
|
|
35
|
+
return node_path_1.default.join(outdir, node_path_1.default.basename(file));
|
|
35
36
|
};
|
|
36
37
|
const downloadS3File = async ({ bucket, key, outdir, region, expectedBucketOwner, }) => {
|
|
37
38
|
const Body = await (0, io_1.lambdaReadFile)({
|
|
@@ -42,19 +43,19 @@ const downloadS3File = async ({ bucket, key, outdir, region, expectedBucketOwner
|
|
|
42
43
|
});
|
|
43
44
|
const outpath = getChunkDownloadOutputLocation({ outdir, file: key });
|
|
44
45
|
if (Buffer.isBuffer(Body)) {
|
|
45
|
-
return
|
|
46
|
+
return node_fs_1.promises.writeFile(outpath, Body);
|
|
46
47
|
}
|
|
47
48
|
return new Promise((resolve, reject) => {
|
|
48
|
-
Body.pipe((0,
|
|
49
|
+
Body.pipe((0, node_fs_1.createWriteStream)(outpath))
|
|
49
50
|
.on('error', (err) => reject(err))
|
|
50
51
|
.on('close', () => resolve());
|
|
51
52
|
});
|
|
52
53
|
};
|
|
53
|
-
const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expectedBucketOwner, }) => {
|
|
54
|
+
const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expectedBucketOwner, onErrors, }) => {
|
|
54
55
|
const alreadyDownloading = {};
|
|
55
56
|
const downloaded = {};
|
|
56
57
|
const getFiles = async () => {
|
|
57
|
-
const prefix = (0, constants_1.
|
|
58
|
+
const prefix = (0, constants_1.rendersPrefix)(renderId);
|
|
58
59
|
const lsTimer = (0, timer_1.timer)('Listing files');
|
|
59
60
|
const contents = await (0, io_1.lambdaLs)({
|
|
60
61
|
bucketName: bucket,
|
|
@@ -63,13 +64,16 @@ const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expect
|
|
|
63
64
|
expectedBucketOwner,
|
|
64
65
|
});
|
|
65
66
|
lsTimer.end();
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
return {
|
|
68
|
+
filesInBucket: contents
|
|
69
|
+
.filter((c) => { var _a; return (_a = c.Key) === null || _a === void 0 ? void 0 : _a.startsWith((0, constants_1.chunkKey)(renderId)); })
|
|
70
|
+
.map((_) => _.Key),
|
|
71
|
+
errorContents: contents.filter((c) => { var _a; return (_a = c.Key) === null || _a === void 0 ? void 0 : _a.startsWith((0, constants_1.getErrorKeyPrefix)(renderId)); }),
|
|
72
|
+
};
|
|
69
73
|
};
|
|
70
74
|
return new Promise((resolve, reject) => {
|
|
71
75
|
const loop = async () => {
|
|
72
|
-
const filesInBucket = await getFiles();
|
|
76
|
+
const { filesInBucket, errorContents } = await getFiles();
|
|
73
77
|
const checkFinish = () => {
|
|
74
78
|
const areAllFilesDownloaded = Object.keys(downloaded).length === expectedFiles;
|
|
75
79
|
console.log('Checking for finish... ', Object.keys(downloaded), expectedFiles + ' files expected');
|
|
@@ -79,6 +83,17 @@ const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expect
|
|
|
79
83
|
}
|
|
80
84
|
};
|
|
81
85
|
console.log('Found ', filesInBucket);
|
|
86
|
+
const errors = (await (0, inspect_errors_1.inspectErrors)({
|
|
87
|
+
bucket,
|
|
88
|
+
contents: errorContents,
|
|
89
|
+
expectedBucketOwner,
|
|
90
|
+
region,
|
|
91
|
+
renderId,
|
|
92
|
+
})).filter((e) => e.isFatal);
|
|
93
|
+
if (errors.length > 0) {
|
|
94
|
+
await onErrors(errors);
|
|
95
|
+
// Will die here
|
|
96
|
+
}
|
|
82
97
|
filesInBucket.forEach(async (key) => {
|
|
83
98
|
if (alreadyDownloading[key]) {
|
|
84
99
|
return;
|
|
@@ -105,49 +120,33 @@ const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expect
|
|
|
105
120
|
const areAllFilesDownloading = Object.keys(alreadyDownloading).length === expectedFiles;
|
|
106
121
|
if (!areAllFilesDownloading) {
|
|
107
122
|
setTimeout(() => {
|
|
108
|
-
loop();
|
|
123
|
+
loop().catch((err) => reject(err));
|
|
109
124
|
}, 100);
|
|
110
125
|
}
|
|
111
126
|
};
|
|
112
|
-
loop();
|
|
127
|
+
loop().catch((err) => reject(err));
|
|
113
128
|
});
|
|
114
129
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
if ((0, fs_1.existsSync)(outdir)) {
|
|
119
|
-
(fs_1.rmSync !== null && fs_1.rmSync !== void 0 ? fs_1.rmSync : fs_1.rmdirSync)(outdir, {
|
|
120
|
-
recursive: true,
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
(0, fs_1.mkdirSync)(outdir);
|
|
124
|
-
const files = await getAllFilesS3({
|
|
125
|
-
bucket,
|
|
126
|
-
expectedFiles,
|
|
127
|
-
outdir,
|
|
128
|
-
renderId,
|
|
129
|
-
region,
|
|
130
|
-
expectedBucketOwner,
|
|
131
|
-
});
|
|
132
|
-
const outfile = (0, path_1.join)(renderer_1.RenderInternals.tmpDir(constants_1.REMOTION_CONCATED_TOKEN), 'concat.' + renderer_1.RenderInternals.getFileExtensionFromCodec(codec, 'final'));
|
|
130
|
+
exports.getAllFilesS3 = getAllFilesS3;
|
|
131
|
+
const concatVideosS3 = async ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, }) => {
|
|
132
|
+
const outfile = (0, node_path_1.join)(renderer_1.RenderInternals.tmpDir(constants_1.REMOTION_CONCATED_TOKEN), 'concat.' + renderer_1.RenderInternals.getFileExtensionFromCodec(codec, audioCodec));
|
|
133
133
|
const combine = (0, timer_1.timer)('Combine videos');
|
|
134
134
|
const filelistDir = renderer_1.RenderInternals.tmpDir(constants_1.REMOTION_FILELIST_TOKEN);
|
|
135
|
-
|
|
136
|
-
const codecForCombining = codec === 'h264-mkv' ? 'h264' : codec;
|
|
137
|
-
await (0, renderer_1.combineVideos)({
|
|
135
|
+
await renderer_1.RenderInternals.combineVideos({
|
|
138
136
|
files,
|
|
139
137
|
filelistDir,
|
|
140
138
|
output: outfile,
|
|
141
|
-
onProgress: (p) => onProgress(p
|
|
139
|
+
onProgress: (p) => onProgress(p),
|
|
142
140
|
numberOfFrames,
|
|
143
|
-
codec
|
|
141
|
+
codec,
|
|
144
142
|
fps,
|
|
145
143
|
numberOfGifLoops,
|
|
144
|
+
audioCodec,
|
|
146
145
|
});
|
|
147
146
|
combine.end();
|
|
148
|
-
const cleanupChunksProm =
|
|
147
|
+
const cleanupChunksProm = node_fs_1.default.promises.rm(outdir, {
|
|
149
148
|
recursive: true,
|
|
150
149
|
});
|
|
151
|
-
return { outfile, cleanupChunksProm
|
|
150
|
+
return { outfile, cleanupChunksProm };
|
|
152
151
|
};
|
|
153
152
|
exports.concatVideosS3 = concatVideosS3;
|
|
File without changes
|
|
@@ -6,9 +6,7 @@ const constants_1 = require("../../shared/constants");
|
|
|
6
6
|
const get_most_expensive_chunks_1 = require("../../shared/get-most-expensive-chunks");
|
|
7
7
|
const parse_lambda_timings_key_1 = require("../../shared/parse-lambda-timings-key");
|
|
8
8
|
const calculate_chunk_times_1 = require("./calculate-chunk-times");
|
|
9
|
-
const get_current_architecture_1 = require("./get-current-architecture");
|
|
10
9
|
const get_files_to_delete_1 = require("./get-files-to-delete");
|
|
11
|
-
const get_lambdas_invoked_stats_1 = require("./get-lambdas-invoked-stats");
|
|
12
10
|
const get_retry_stats_1 = require("./get-retry-stats");
|
|
13
11
|
const get_time_to_finish_1 = require("./get-time-to-finish");
|
|
14
12
|
const createPostRenderData = ({ renderId, region, memorySizeInMb, renderMetadata, contents, timeToEncode, errorExplanations, timeToDelete, outputFile, }) => {
|
|
@@ -21,7 +19,6 @@ const createPostRenderData = ({ renderId, region, memorySizeInMb, renderMetadata
|
|
|
21
19
|
durationInMiliseconds: times,
|
|
22
20
|
memorySizeInMb,
|
|
23
21
|
region,
|
|
24
|
-
architecture: (0, get_current_architecture_1.getCurrentArchitecture)(),
|
|
25
22
|
lambdasInvoked: renderMetadata.estimatedTotalLambdaInvokations,
|
|
26
23
|
// We cannot determine the ephemeral storage size, so we
|
|
27
24
|
// overestimate the price, but will only have a miniscule effect (~0.2%)
|
|
@@ -41,17 +38,7 @@ const createPostRenderData = ({ renderId, region, memorySizeInMb, renderMetadata
|
|
|
41
38
|
const renderSize = contents
|
|
42
39
|
.map((c) => { var _a; return (_a = c.Size) !== null && _a !== void 0 ? _a : 0; })
|
|
43
40
|
.reduce((a, b) => a + b, 0);
|
|
44
|
-
const { timeToInvokeLambdas } = (0, get_lambdas_invoked_stats_1.getLambdasInvokedStats)({
|
|
45
|
-
contents,
|
|
46
|
-
renderId,
|
|
47
|
-
estimatedRenderLambdaInvokations: renderMetadata.estimatedRenderLambdaInvokations,
|
|
48
|
-
startDate: renderMetadata.startedDate,
|
|
49
|
-
checkIfAllLambdasWereInvoked: false,
|
|
50
|
-
});
|
|
51
41
|
const retriesInfo = (0, get_retry_stats_1.getRetryStats)({ contents, renderId });
|
|
52
|
-
if (timeToInvokeLambdas === null) {
|
|
53
|
-
throw new Error('should have timing for all lambdas');
|
|
54
|
-
}
|
|
55
42
|
return {
|
|
56
43
|
cost: {
|
|
57
44
|
currency: 'USD',
|
|
@@ -81,9 +68,8 @@ const createPostRenderData = ({ renderId, region, memorySizeInMb, renderMetadata
|
|
|
81
68
|
renderId,
|
|
82
69
|
type: 'absolute-time',
|
|
83
70
|
}),
|
|
84
|
-
timeToInvokeLambdas,
|
|
85
71
|
retriesInfo,
|
|
86
|
-
mostExpensiveFrameRanges: (0, get_most_expensive_chunks_1.getMostExpensiveChunks)(parsedTimings, renderMetadata.framesPerLambda),
|
|
72
|
+
mostExpensiveFrameRanges: (0, get_most_expensive_chunks_1.getMostExpensiveChunks)(parsedTimings, renderMetadata.framesPerLambda, renderMetadata.frameRange[1]),
|
|
87
73
|
};
|
|
88
74
|
};
|
|
89
75
|
exports.createPostRenderData = createPostRenderData;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -25,7 +25,7 @@ const getExpectedOutName = (renderMetadata, bucketName, customCredentials) => {
|
|
|
25
25
|
renderMetadata,
|
|
26
26
|
});
|
|
27
27
|
if (outNameValue) {
|
|
28
|
-
(0, validate_outname_1.validateOutname)(outNameValue);
|
|
28
|
+
(0, validate_outname_1.validateOutname)(outNameValue, renderMetadata.codec, renderMetadata.audioCodec);
|
|
29
29
|
return (0, defaults_1.customOutName)(renderMetadata.renderId, bucketName, outNameValue);
|
|
30
30
|
}
|
|
31
31
|
if (renderMetadata.type === 'still') {
|
|
@@ -38,7 +38,7 @@ const getExpectedOutName = (renderMetadata, bucketName, customCredentials) => {
|
|
|
38
38
|
if (renderMetadata.type === 'video') {
|
|
39
39
|
return {
|
|
40
40
|
renderBucketName: bucketName,
|
|
41
|
-
key: (0, defaults_1.outName)(renderMetadata.renderId, renderer_1.RenderInternals.getFileExtensionFromCodec(renderMetadata.codec,
|
|
41
|
+
key: (0, defaults_1.outName)(renderMetadata.renderId, renderer_1.RenderInternals.getFileExtensionFromCodec(renderMetadata.codec, renderMetadata.audioCodec)),
|
|
42
42
|
customCredentials: null,
|
|
43
43
|
};
|
|
44
44
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AwsRegion } from '../..';
|
|
2
2
|
import type { CustomCredentials } from '../../shared/aws-clients';
|
|
3
3
|
import type { RenderMetadata } from '../../shared/constants';
|
|
4
|
-
export
|
|
4
|
+
export type OutputFileMetadata = {
|
|
5
5
|
url: string;
|
|
6
6
|
size: number;
|
|
7
7
|
lastModified: number;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import type { ChromiumOptions } from '@remotion/renderer';
|
|
2
|
-
import { openBrowser } from '@remotion/renderer';
|
|
1
|
+
import type { ChromiumOptions, openBrowser } from '@remotion/renderer';
|
|
3
2
|
export declare const getBrowserInstance: (shouldDumpIo: boolean, chromiumOptions: ChromiumOptions) => ReturnType<typeof openBrowser>;
|
|
@@ -32,20 +32,24 @@ const getBrowserInstance = async (shouldDumpIo, chromiumOptions) => {
|
|
|
32
32
|
return _browserInstance;
|
|
33
33
|
}
|
|
34
34
|
launching = true;
|
|
35
|
-
const execPath =
|
|
35
|
+
const execPath = (0, get_chromium_executable_path_1.executablePath)();
|
|
36
36
|
const actualChromiumOptions = {
|
|
37
37
|
...chromiumOptions,
|
|
38
38
|
// Override the `null` value, which might come from CLI with swANGLE
|
|
39
39
|
gl: (_a = chromiumOptions.gl) !== null && _a !== void 0 ? _a : 'swangle',
|
|
40
40
|
};
|
|
41
|
-
_browserInstance = await
|
|
41
|
+
_browserInstance = await renderer_1.RenderInternals.internalOpenBrowser({
|
|
42
|
+
browser: 'chrome',
|
|
42
43
|
browserExecutable: execPath,
|
|
43
44
|
shouldDumpIo,
|
|
44
45
|
chromiumOptions: actualChromiumOptions,
|
|
46
|
+
forceDeviceScaleFactor: undefined,
|
|
47
|
+
indent: false,
|
|
48
|
+
viewport: null,
|
|
45
49
|
});
|
|
46
50
|
_browserInstance.on('disconnected', () => {
|
|
47
51
|
console.log('Browser disconnected / crashed');
|
|
48
|
-
_browserInstance === null || _browserInstance === void 0 ? void 0 : _browserInstance.close().catch(() => undefined);
|
|
52
|
+
_browserInstance === null || _browserInstance === void 0 ? void 0 : _browserInstance.close(true).catch(() => undefined);
|
|
49
53
|
_browserInstance = null;
|
|
50
54
|
});
|
|
51
55
|
launching = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const executablePath: () =>
|
|
1
|
+
export declare const executablePath: () => string;
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.executablePath = void 0;
|
|
5
|
-
if (/^AWS_Lambda_nodejs(?:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
process.env.
|
|
5
|
+
if (/^AWS_Lambda_nodejs(?:18)[.]x$/.test((_a = process.env.AWS_EXECUTION_ENV) !== null && _a !== void 0 ? _a : '') ===
|
|
6
|
+
true) {
|
|
7
|
+
process.env.FONTCONFIG_PATH = '/opt';
|
|
8
|
+
process.env.FONTCONFIG_FILE = '/opt/fonts.conf';
|
|
9
|
+
process.env.READ_ONLY_FS = '1';
|
|
10
|
+
process.env.COMPOSITOR_PATH = './compositor';
|
|
11
|
+
process.env.NO_COLOR = '1';
|
|
10
12
|
}
|
|
11
|
-
const executablePath =
|
|
13
|
+
const executablePath = () => {
|
|
12
14
|
return '/opt/bin/chromium';
|
|
13
15
|
};
|
|
14
16
|
exports.executablePath = executablePath;
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "us-east-1" | "us-east-2" | "us-west-2" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1";
|
|
1
|
+
export declare const getCurrentRegionInFunction: () => "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "ap-south-1" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ca-central-1" | "sa-east-1" | "eu-south-1" | "af-south-1" | "ap-east-1" | "me-south-1";
|
|
File without changes
|
|
File without changes
|
|
@@ -10,7 +10,7 @@ const getCustomOutName = ({ renderMetadata, customCredentials, }) => {
|
|
|
10
10
|
return renderMetadata.outName;
|
|
11
11
|
}
|
|
12
12
|
if (renderMetadata.outName.s3OutputProvider) {
|
|
13
|
-
if (!customCredentials && renderMetadata.privacy
|
|
13
|
+
if (!customCredentials && renderMetadata.privacy === 'private') {
|
|
14
14
|
throw new TypeError(`The file was rendered with a custom S3 implementation and is not public, but no custom credentials were passed to downloadMedia().`);
|
|
15
15
|
}
|
|
16
16
|
return {
|