@remotion/lambda 4.0.0-bitrate.18 → 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.
Files changed (380) hide show
  1. package/LICENSE.md +8 -8
  2. package/dist/admin/bundle-lambda.d.ts +0 -0
  3. package/dist/admin/bundle-lambda.js +0 -0
  4. package/dist/admin/make-layer-public.d.ts +0 -0
  5. package/dist/admin/make-layer-public.js +0 -0
  6. package/dist/api/bucket-exists.d.ts +0 -0
  7. package/dist/api/bucket-exists.js +0 -0
  8. package/dist/api/clean-items.d.ts +0 -0
  9. package/dist/api/clean-items.js +0 -0
  10. package/dist/api/create-bucket.d.ts +0 -0
  11. package/dist/api/create-bucket.js +0 -0
  12. package/dist/api/create-function.d.ts +0 -0
  13. package/dist/api/create-function.js +0 -0
  14. package/dist/api/delete-function.d.ts +0 -0
  15. package/dist/api/delete-function.js +0 -0
  16. package/dist/api/delete-render.d.ts +0 -0
  17. package/dist/api/delete-render.js +0 -0
  18. package/dist/api/delete-site.d.ts +0 -0
  19. package/dist/api/delete-site.js +0 -0
  20. package/dist/api/deploy-function.d.ts +0 -0
  21. package/dist/api/deploy-function.js +0 -0
  22. package/dist/api/deploy-site.d.ts +0 -0
  23. package/dist/api/deploy-site.js +0 -0
  24. package/dist/api/download-media.d.ts +0 -0
  25. package/dist/api/download-media.js +0 -0
  26. package/dist/api/enable-s3-website.d.ts +0 -0
  27. package/dist/api/enable-s3-website.js +0 -0
  28. package/dist/api/estimate-price.d.ts +0 -0
  29. package/dist/api/estimate-price.js +0 -0
  30. package/dist/api/get-aws-client.d.ts +0 -0
  31. package/dist/api/get-aws-client.js +0 -0
  32. package/dist/api/get-buckets.d.ts +0 -0
  33. package/dist/api/get-buckets.js +0 -0
  34. package/dist/api/get-compositions-on-lambda.d.ts +28 -0
  35. package/dist/api/get-compositions-on-lambda.js +54 -0
  36. package/dist/api/get-function-info.d.ts +0 -0
  37. package/dist/api/get-function-info.js +0 -0
  38. package/dist/api/get-functions.d.ts +0 -0
  39. package/dist/api/get-functions.js +0 -0
  40. package/dist/api/get-or-create-bucket.d.ts +0 -0
  41. package/dist/api/get-or-create-bucket.js +0 -0
  42. package/dist/api/get-regions.d.ts +0 -0
  43. package/dist/api/get-regions.js +0 -0
  44. package/dist/api/get-render-progress.d.ts +0 -0
  45. package/dist/api/get-render-progress.js +0 -0
  46. package/dist/api/get-sites.d.ts +0 -0
  47. package/dist/api/get-sites.js +0 -0
  48. package/dist/api/iam-validation/role-permissions.d.ts +0 -0
  49. package/dist/api/iam-validation/role-permissions.js +0 -0
  50. package/dist/api/iam-validation/simulate-rule.d.ts +0 -0
  51. package/dist/api/iam-validation/simulate-rule.js +0 -0
  52. package/dist/api/iam-validation/simulate.d.ts +0 -0
  53. package/dist/api/iam-validation/simulate.js +0 -0
  54. package/dist/api/iam-validation/suggested-policy.d.ts +0 -0
  55. package/dist/api/iam-validation/suggested-policy.js +0 -0
  56. package/dist/api/iam-validation/user-permissions.d.ts +0 -0
  57. package/dist/api/iam-validation/user-permissions.js +0 -0
  58. package/dist/api/mock-functions.d.ts +0 -0
  59. package/dist/api/mock-functions.js +0 -0
  60. package/dist/api/presign-url.d.ts +0 -0
  61. package/dist/api/presign-url.js +0 -0
  62. package/dist/api/render-media-on-lambda.d.ts +5 -2
  63. package/dist/api/render-media-on-lambda.js +22 -7
  64. package/dist/api/render-still-on-lambda.d.ts +3 -1
  65. package/dist/api/render-still-on-lambda.js +12 -4
  66. package/dist/api/upload-dir.d.ts +0 -0
  67. package/dist/api/upload-dir.js +0 -0
  68. package/dist/api/validate-webhook-signature.d.ts +0 -0
  69. package/dist/api/validate-webhook-signature.js +0 -0
  70. package/dist/cli/args.d.ts +2 -2
  71. package/dist/cli/args.js +1 -5
  72. package/dist/cli/commands/compositions/index.d.ts +2 -0
  73. package/dist/cli/commands/compositions/index.js +44 -0
  74. package/dist/cli/commands/functions/deploy.d.ts +0 -0
  75. package/dist/cli/commands/functions/deploy.js +0 -0
  76. package/dist/cli/commands/functions/index.d.ts +0 -0
  77. package/dist/cli/commands/functions/index.js +0 -0
  78. package/dist/cli/commands/functions/ls.d.ts +0 -0
  79. package/dist/cli/commands/functions/ls.js +0 -0
  80. package/dist/cli/commands/functions/rm.d.ts +0 -0
  81. package/dist/cli/commands/functions/rm.js +0 -0
  82. package/dist/cli/commands/functions/rmall.d.ts +0 -0
  83. package/dist/cli/commands/functions/rmall.js +0 -0
  84. package/dist/cli/commands/policies/policies.d.ts +0 -0
  85. package/dist/cli/commands/policies/policies.js +0 -0
  86. package/dist/cli/commands/policies/role.d.ts +0 -0
  87. package/dist/cli/commands/policies/role.js +0 -0
  88. package/dist/cli/commands/policies/user.d.ts +0 -0
  89. package/dist/cli/commands/policies/user.js +0 -0
  90. package/dist/cli/commands/policies/validate.d.ts +0 -0
  91. package/dist/cli/commands/policies/validate.js +0 -0
  92. package/dist/cli/commands/quotas/increase.d.ts +0 -0
  93. package/dist/cli/commands/quotas/increase.js +0 -0
  94. package/dist/cli/commands/quotas/index.d.ts +0 -0
  95. package/dist/cli/commands/quotas/index.js +0 -0
  96. package/dist/cli/commands/quotas/list.d.ts +0 -0
  97. package/dist/cli/commands/quotas/list.js +0 -0
  98. package/dist/cli/commands/regions.d.ts +0 -0
  99. package/dist/cli/commands/regions.js +0 -0
  100. package/dist/cli/commands/render/progress.d.ts +2 -1
  101. package/dist/cli/commands/render/progress.js +10 -3
  102. package/dist/cli/commands/render/render.d.ts +1 -1
  103. package/dist/cli/commands/render/render.js +23 -10
  104. package/dist/cli/commands/sites/create.d.ts +1 -1
  105. package/dist/cli/commands/sites/create.js +9 -4
  106. package/dist/cli/commands/sites/index.d.ts +1 -1
  107. package/dist/cli/commands/sites/index.js +2 -2
  108. package/dist/cli/commands/sites/ls.d.ts +0 -0
  109. package/dist/cli/commands/sites/ls.js +0 -0
  110. package/dist/cli/commands/sites/rm.d.ts +0 -0
  111. package/dist/cli/commands/sites/rm.js +0 -0
  112. package/dist/cli/commands/sites/rmall.d.ts +0 -0
  113. package/dist/cli/commands/sites/rmall.js +0 -0
  114. package/dist/cli/commands/still.d.ts +1 -1
  115. package/dist/cli/commands/still.js +19 -11
  116. package/dist/cli/get-aws-region.d.ts +0 -0
  117. package/dist/cli/get-aws-region.js +0 -0
  118. package/dist/cli/help.d.ts +0 -0
  119. package/dist/cli/help.js +0 -0
  120. package/dist/cli/helpers/confirm.d.ts +0 -0
  121. package/dist/cli/helpers/confirm.js +0 -0
  122. package/dist/cli/helpers/date-string.d.ts +0 -0
  123. package/dist/cli/helpers/date-string.js +0 -0
  124. package/dist/cli/helpers/find-function-name.d.ts +0 -0
  125. package/dist/cli/helpers/find-function-name.js +0 -0
  126. package/dist/cli/helpers/progress-bar.d.ts +0 -0
  127. package/dist/cli/helpers/progress-bar.js +0 -0
  128. package/dist/cli/helpers/quit.d.ts +0 -0
  129. package/dist/cli/helpers/quit.js +0 -0
  130. package/dist/cli/helpers/yes-or-no.d.ts +0 -0
  131. package/dist/cli/helpers/yes-or-no.js +0 -0
  132. package/dist/cli/index.d.ts +1 -1
  133. package/dist/cli/index.js +14 -8
  134. package/dist/cli/is-cli.d.ts +0 -0
  135. package/dist/cli/is-cli.js +0 -0
  136. package/dist/cli/log.d.ts +0 -0
  137. package/dist/cli/log.js +0 -0
  138. package/dist/client.d.ts +2 -1
  139. package/dist/client.js +3 -1
  140. package/dist/defaults.d.ts +0 -0
  141. package/dist/defaults.js +0 -0
  142. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +2 -9
  143. package/dist/functions/chunk-optimization/plan-frame-ranges.js +1 -14
  144. package/dist/functions/chunk-optimization/types.d.ts +0 -11
  145. package/dist/functions/chunk-optimization/types.js +0 -0
  146. package/dist/functions/compositions.d.ts +8 -0
  147. package/dist/functions/compositions.js +50 -0
  148. package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +0 -0
  149. package/dist/functions/helpers/best-frames-per-lambda-param.js +0 -0
  150. package/dist/functions/helpers/calculate-chunk-times.d.ts +0 -0
  151. package/dist/functions/helpers/calculate-chunk-times.js +0 -0
  152. package/dist/functions/helpers/calculate-price-from-bucket.d.ts +0 -0
  153. package/dist/functions/helpers/calculate-price-from-bucket.js +0 -0
  154. package/dist/functions/helpers/check-if-render-exists.d.ts +0 -0
  155. package/dist/functions/helpers/check-if-render-exists.js +0 -0
  156. package/dist/functions/helpers/clean-tmpdir.d.ts +0 -0
  157. package/dist/functions/helpers/clean-tmpdir.js +1 -1
  158. package/dist/functions/helpers/concat-videos.d.ts +6 -1
  159. package/dist/functions/helpers/concat-videos.js +27 -9
  160. package/dist/functions/helpers/create-post-render-data.d.ts +0 -0
  161. package/dist/functions/helpers/create-post-render-data.js +0 -0
  162. package/dist/functions/helpers/delete-chunks.d.ts +0 -0
  163. package/dist/functions/helpers/delete-chunks.js +0 -0
  164. package/dist/functions/helpers/expected-out-name.d.ts +0 -0
  165. package/dist/functions/helpers/expected-out-name.js +0 -0
  166. package/dist/functions/helpers/find-output-file-in-bucket.d.ts +0 -0
  167. package/dist/functions/helpers/find-output-file-in-bucket.js +0 -0
  168. package/dist/functions/helpers/format-costs-info.d.ts +0 -0
  169. package/dist/functions/helpers/format-costs-info.js +0 -0
  170. package/dist/functions/helpers/get-browser-instance.d.ts +0 -0
  171. package/dist/functions/helpers/get-browser-instance.js +1 -1
  172. package/dist/functions/helpers/get-chromium-executable-path.d.ts +0 -0
  173. package/dist/functions/helpers/get-chromium-executable-path.js +0 -0
  174. package/dist/functions/helpers/get-cleanup-progress.d.ts +0 -0
  175. package/dist/functions/helpers/get-cleanup-progress.js +0 -0
  176. package/dist/functions/helpers/get-current-architecture.d.ts +0 -0
  177. package/dist/functions/helpers/get-current-architecture.js +0 -0
  178. package/dist/functions/helpers/get-current-region.d.ts +0 -0
  179. package/dist/functions/helpers/get-current-region.js +0 -0
  180. package/dist/functions/helpers/get-custom-out-name.d.ts +0 -0
  181. package/dist/functions/helpers/get-custom-out-name.js +1 -1
  182. package/dist/functions/helpers/get-encoding-metadata.d.ts +0 -0
  183. package/dist/functions/helpers/get-encoding-metadata.js +0 -0
  184. package/dist/functions/helpers/get-files-in-folder.d.ts +0 -0
  185. package/dist/functions/helpers/get-files-in-folder.js +0 -0
  186. package/dist/functions/helpers/get-files-to-delete.d.ts +0 -0
  187. package/dist/functions/helpers/get-files-to-delete.js +0 -0
  188. package/dist/functions/helpers/get-final-encoding-status.d.ts +0 -0
  189. package/dist/functions/helpers/get-final-encoding-status.js +0 -0
  190. package/dist/functions/helpers/get-folder-size.d.ts +0 -0
  191. package/dist/functions/helpers/get-folder-size.js +0 -0
  192. package/dist/functions/helpers/get-lambdas-invoked-stats.d.ts +0 -0
  193. package/dist/functions/helpers/get-lambdas-invoked-stats.js +0 -0
  194. package/dist/functions/helpers/get-output-url-from-metadata.d.ts +0 -0
  195. package/dist/functions/helpers/get-output-url-from-metadata.js +0 -0
  196. package/dist/functions/helpers/get-overall-progress.d.ts +0 -0
  197. package/dist/functions/helpers/get-overall-progress.js +0 -0
  198. package/dist/functions/helpers/get-post-render-data.d.ts +0 -0
  199. package/dist/functions/helpers/get-post-render-data.js +0 -0
  200. package/dist/functions/helpers/get-progress.d.ts +0 -0
  201. package/dist/functions/helpers/get-progress.js +0 -0
  202. package/dist/functions/helpers/get-render-metadata.d.ts +0 -0
  203. package/dist/functions/helpers/get-render-metadata.js +0 -0
  204. package/dist/functions/helpers/get-retry-stats.d.ts +0 -0
  205. package/dist/functions/helpers/get-retry-stats.js +0 -0
  206. package/dist/functions/helpers/get-time-to-finish.d.ts +0 -0
  207. package/dist/functions/helpers/get-time-to-finish.js +0 -0
  208. package/dist/functions/helpers/inspect-errors.d.ts +0 -0
  209. package/dist/functions/helpers/inspect-errors.js +0 -0
  210. package/dist/functions/helpers/io.d.ts +0 -0
  211. package/dist/functions/helpers/io.js +3 -1
  212. package/dist/functions/helpers/is-enosp-err.d.ts +0 -0
  213. package/dist/functions/helpers/is-enosp-err.js +0 -0
  214. package/dist/functions/helpers/is-warm.d.ts +0 -0
  215. package/dist/functions/helpers/is-warm.js +0 -0
  216. package/dist/functions/helpers/min-max.d.ts +0 -0
  217. package/dist/functions/helpers/min-max.js +0 -0
  218. package/dist/functions/helpers/print-cloudwatch-helper.d.ts +0 -0
  219. package/dist/functions/helpers/print-cloudwatch-helper.js +0 -0
  220. package/dist/functions/helpers/print-concurrency-curve.d.ts +0 -0
  221. package/dist/functions/helpers/print-concurrency-curve.js +0 -0
  222. package/dist/functions/helpers/read-with-progress.d.ts +0 -0
  223. package/dist/functions/helpers/read-with-progress.js +1 -1
  224. package/dist/functions/helpers/timer.d.ts +0 -0
  225. package/dist/functions/helpers/timer.js +0 -0
  226. package/dist/functions/helpers/validate-composition.d.ts +3 -1
  227. package/dist/functions/helpers/validate-composition.js +6 -2
  228. package/dist/functions/helpers/write-lambda-error.d.ts +0 -0
  229. package/dist/functions/helpers/write-lambda-error.js +0 -0
  230. package/dist/functions/helpers/write-post-render-data.d.ts +0 -0
  231. package/dist/functions/helpers/write-post-render-data.js +0 -0
  232. package/dist/functions/index.d.ts +0 -0
  233. package/dist/functions/index.js +13 -1
  234. package/dist/functions/info.d.ts +0 -0
  235. package/dist/functions/info.js +0 -0
  236. package/dist/functions/launch.d.ts +1 -0
  237. package/dist/functions/launch.js +68 -71
  238. package/dist/functions/progress.d.ts +0 -0
  239. package/dist/functions/progress.js +2 -2
  240. package/dist/functions/renderer.d.ts +0 -0
  241. package/dist/functions/renderer.js +10 -2
  242. package/dist/functions/start.d.ts +0 -0
  243. package/dist/functions/start.js +6 -2
  244. package/dist/functions/still.d.ts +0 -0
  245. package/dist/functions/still.js +22 -6
  246. package/dist/index.d.ts +6 -2
  247. package/dist/index.js +3 -1
  248. package/dist/internals.d.ts +1 -1
  249. package/dist/internals.js +0 -0
  250. package/dist/pricing/aws-regions.d.ts +0 -0
  251. package/dist/pricing/aws-regions.js +0 -0
  252. package/dist/pricing/price-per-1-s.d.ts +0 -0
  253. package/dist/pricing/price-per-1-s.js +0 -0
  254. package/dist/regions.d.ts +0 -0
  255. package/dist/regions.js +0 -0
  256. package/dist/shared/await.d.ts +0 -0
  257. package/dist/shared/await.js +0 -0
  258. package/dist/shared/aws-clients.d.ts +0 -0
  259. package/dist/shared/aws-clients.js +0 -0
  260. package/dist/shared/bundle-site.d.ts +0 -0
  261. package/dist/shared/bundle-site.js +0 -0
  262. package/dist/shared/call-lambda.d.ts +0 -0
  263. package/dist/shared/call-lambda.js +0 -0
  264. package/dist/shared/check-credentials.d.ts +0 -0
  265. package/dist/shared/check-credentials.js +0 -0
  266. package/dist/shared/cleanup-serialized-input-props.d.ts +7 -0
  267. package/dist/shared/cleanup-serialized-input-props.js +19 -0
  268. package/dist/shared/constants.d.ts +37 -14
  269. package/dist/shared/constants.js +6 -3
  270. package/dist/shared/content-disposition-header.d.ts +0 -0
  271. package/dist/shared/content-disposition-header.js +0 -0
  272. package/dist/shared/convert-to-serve-url.d.ts +0 -0
  273. package/dist/shared/convert-to-serve-url.js +0 -0
  274. package/dist/shared/deserialize-input-props.d.ts +8 -0
  275. package/dist/shared/deserialize-input-props.js +26 -0
  276. package/dist/shared/docs-url.d.ts +0 -0
  277. package/dist/shared/docs-url.js +0 -0
  278. package/dist/shared/function-zip-path.d.ts +0 -0
  279. package/dist/shared/function-zip-path.js +0 -0
  280. package/dist/shared/get-account-id.d.ts +0 -0
  281. package/dist/shared/get-account-id.js +0 -0
  282. package/dist/shared/get-aws-urls.d.ts +13 -0
  283. package/dist/{cli/helpers/get-cloudwatch-stream-url.js → shared/get-aws-urls.js} +5 -1
  284. package/dist/shared/get-cloudwatch-stream-url.d.ts +0 -0
  285. package/dist/shared/get-cloudwatch-stream-url.js +0 -0
  286. package/dist/shared/get-function-version.d.ts +0 -0
  287. package/dist/shared/get-function-version.js +0 -0
  288. package/dist/shared/get-most-expensive-chunks.d.ts +0 -0
  289. package/dist/shared/get-most-expensive-chunks.js +0 -0
  290. package/dist/shared/hosted-layers.d.ts +0 -0
  291. package/dist/shared/hosted-layers.js +0 -0
  292. package/dist/shared/invoke-webhook.d.ts +0 -0
  293. package/dist/shared/invoke-webhook.js +0 -0
  294. package/dist/shared/is-in-lambda.d.ts +0 -0
  295. package/dist/shared/is-in-lambda.js +0 -0
  296. package/dist/shared/lambda-version-string.d.ts +0 -0
  297. package/dist/shared/lambda-version-string.js +0 -0
  298. package/dist/shared/make-s3-key.d.ts +0 -0
  299. package/dist/shared/make-s3-key.js +0 -0
  300. package/dist/shared/make-s3-url.d.ts +0 -0
  301. package/dist/shared/make-s3-url.js +0 -0
  302. package/dist/shared/p-limit.d.ts +0 -0
  303. package/dist/shared/p-limit.js +0 -0
  304. package/dist/shared/parse-lambda-initialized-key.d.ts +0 -0
  305. package/dist/shared/parse-lambda-initialized-key.js +0 -0
  306. package/dist/shared/parse-lambda-timings-key.d.ts +0 -0
  307. package/dist/shared/parse-lambda-timings-key.js +0 -0
  308. package/dist/shared/random-hash.d.ts +0 -0
  309. package/dist/shared/random-hash.js +0 -0
  310. package/dist/shared/return-values.d.ts +2 -0
  311. package/dist/shared/return-values.js +0 -0
  312. package/dist/shared/serialize-input-props.d.ts +7 -0
  313. package/dist/shared/serialize-input-props.js +42 -0
  314. package/dist/shared/sleep.d.ts +0 -0
  315. package/dist/shared/sleep.js +0 -0
  316. package/dist/shared/stream-to-string.d.ts +0 -0
  317. package/dist/shared/stream-to-string.js +0 -0
  318. package/dist/shared/truthy.d.ts +0 -0
  319. package/dist/shared/truthy.js +0 -0
  320. package/dist/shared/validate-architecture.d.ts +0 -0
  321. package/dist/shared/validate-architecture.js +0 -0
  322. package/dist/shared/validate-aws-region.d.ts +0 -0
  323. package/dist/shared/validate-aws-region.js +0 -0
  324. package/dist/shared/validate-bucketname.d.ts +0 -0
  325. package/dist/shared/validate-bucketname.js +0 -0
  326. package/dist/shared/validate-custom-role-arn.d.ts +0 -0
  327. package/dist/shared/validate-custom-role-arn.js +0 -0
  328. package/dist/shared/validate-disk-size-in-mb.d.ts +0 -0
  329. package/dist/shared/validate-disk-size-in-mb.js +0 -0
  330. package/dist/shared/validate-download-behavior.d.ts +0 -0
  331. package/dist/shared/validate-download-behavior.js +0 -0
  332. package/dist/shared/validate-frames-per-lambda.d.ts +0 -0
  333. package/dist/shared/validate-frames-per-lambda.js +0 -0
  334. package/dist/shared/validate-lambda-codec.d.ts +0 -0
  335. package/dist/shared/validate-lambda-codec.js +0 -0
  336. package/dist/shared/validate-memory-size.d.ts +0 -0
  337. package/dist/shared/validate-memory-size.js +0 -0
  338. package/dist/shared/validate-outname.d.ts +0 -0
  339. package/dist/shared/validate-outname.js +0 -0
  340. package/dist/shared/validate-presign-expiration.d.ts +0 -0
  341. package/dist/shared/validate-presign-expiration.js +0 -0
  342. package/dist/shared/validate-privacy.d.ts +0 -0
  343. package/dist/shared/validate-privacy.js +0 -0
  344. package/dist/shared/validate-retention-period.d.ts +0 -0
  345. package/dist/shared/validate-retention-period.js +0 -0
  346. package/dist/shared/validate-retries.d.ts +0 -0
  347. package/dist/shared/validate-retries.js +0 -0
  348. package/dist/shared/validate-serveurl.d.ts +0 -0
  349. package/dist/shared/validate-serveurl.js +0 -0
  350. package/dist/shared/validate-site-name.d.ts +0 -0
  351. package/dist/shared/validate-site-name.js +0 -0
  352. package/dist/shared/validate-timeout.d.ts +0 -0
  353. package/dist/shared/validate-timeout.js +0 -0
  354. package/package.json +19 -22
  355. package/remotionlambda.zip +0 -0
  356. package/dist/cli/helpers/determine-image-format.d.ts +0 -10
  357. package/dist/cli/helpers/determine-image-format.js +0 -47
  358. package/dist/cli/helpers/get-cloudwatch-stream-url.d.ts +0 -8
  359. package/dist/cli/helpers/webhook-types.d.ts +0 -6
  360. package/dist/cli/helpers/webhook-types.js +0 -2
  361. package/dist/functions/chunk-optimization/can-use-optimization.d.ts +0 -6
  362. package/dist/functions/chunk-optimization/can-use-optimization.js +0 -23
  363. package/dist/functions/chunk-optimization/collect-data.d.ts +0 -9
  364. package/dist/functions/chunk-optimization/collect-data.js +0 -27
  365. package/dist/functions/chunk-optimization/get-frame-ranges-from-profile.d.ts +0 -3
  366. package/dist/functions/chunk-optimization/get-frame-ranges-from-profile.js +0 -11
  367. package/dist/functions/chunk-optimization/get-profile-duration.d.ts +0 -3
  368. package/dist/functions/chunk-optimization/get-profile-duration.js +0 -18
  369. package/dist/functions/chunk-optimization/is-valid-profile.d.ts +0 -2
  370. package/dist/functions/chunk-optimization/is-valid-profile.js +0 -12
  371. package/dist/functions/chunk-optimization/optimize-invocation-order.d.ts +0 -2
  372. package/dist/functions/chunk-optimization/optimize-invocation-order.js +0 -19
  373. package/dist/functions/chunk-optimization/optimize-profile.d.ts +0 -9
  374. package/dist/functions/chunk-optimization/optimize-profile.js +0 -74
  375. package/dist/functions/chunk-optimization/s3-optimization-file.d.ts +0 -17
  376. package/dist/functions/chunk-optimization/s3-optimization-file.js +0 -47
  377. package/dist/functions/chunk-optimization/simulate-frame-ranges.d.ts +0 -7
  378. package/dist/functions/chunk-optimization/simulate-frame-ranges.js +0 -47
  379. package/dist/functions/chunk-optimization/sort-by-duration.d.ts +0 -2
  380. package/dist/functions/chunk-optimization/sort-by-duration.js +0 -25
@@ -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(params.timeoutInMilliseconds - 1000, 1000));
115
- const [browserInstance, optimization] = await Promise.all([
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: params.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 how this parameter is calculated.`);
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, didUseOptimization } = (0, plan_frame_ranges_1.planFrameRanges)({
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
- let chunkProm = Promise.resolve();
346
- // TODO: Enable in a later release
347
- const enableChunkOptimization = false;
348
- if (enableChunkOptimization) {
349
- const chunkData = await (0, collect_data_1.collectChunkInformation)({
350
- bucketName: params.bucketName,
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 = (0, delete_chunks_1.cleanupFiles)({
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
- bucket: params.bucketName,
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(), the deployed Lambda function had version ${version_1.VERSION} but the @remotion/lambda package is an older version. Align the versions.`);
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(), get deployed Lambda function had version ${version_1.VERSION} and the @remotion/lambda package has version ${lambdaParams.version}. Align the versions.`);
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: params.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
@@ -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(), the deployed Lambda function had version ${version_1.VERSION} but the @remotion/lambda package is an older version. Align the versions.`);
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(), get deployed Lambda function had version ${version_1.VERSION} and the @remotion/lambda package has version ${params.version}. Align the versions.`);
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
@@ -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(), the deployed Lambda function had version ${version_1.VERSION} but the @remotion/lambda package is an older version. Align the versions.`);
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(), get deployed Lambda function had version ${version_1.VERSION} and the @remotion/lambda package has version ${lambdaParams.version}. Align the versions.`);
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: lambdaParams.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: lambdaParams.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 fs_1.default.promises.rm(outputPath, { recursive: true });
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");
@@ -1,3 +1,3 @@
1
1
  export declare const LambdaInternals: {
2
- executeCommand: (args: string[]) => Promise<void>;
2
+ executeCommand: (args: string[], remotionRoot: string) => Promise<void>;
3
3
  };
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
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
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;