@remotion/renderer 2.5.1 → 2.5.5-alpha.12

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 (66) hide show
  1. package/dist/add-silent-audio-if-necessary.d.ts +1 -1
  2. package/dist/add-silent-audio-if-necessary.d.ts.map +1 -1
  3. package/dist/add-silent-audio-if-necessary.js +6 -2
  4. package/dist/add-silent-audio-if-necessary.js.map +1 -1
  5. package/dist/create-ffmpeg-complex-filter.d.ts +4 -1
  6. package/dist/create-ffmpeg-complex-filter.d.ts.map +1 -1
  7. package/dist/delete-directory.d.ts +2 -0
  8. package/dist/delete-directory.d.ts.map +1 -0
  9. package/dist/delete-directory.js +28 -0
  10. package/dist/delete-directory.js.map +1 -0
  11. package/dist/ffmpeg-flags.d.ts.map +1 -1
  12. package/dist/ffmpeg-flags.js +3 -3
  13. package/dist/ffmpeg-flags.js.map +1 -1
  14. package/dist/get-browser-instance.d.ts +10 -0
  15. package/dist/get-browser-instance.d.ts.map +1 -0
  16. package/dist/get-browser-instance.js +35 -0
  17. package/dist/get-browser-instance.js.map +1 -0
  18. package/dist/get-extension-from-codec.d.ts +3 -0
  19. package/dist/get-extension-from-codec.d.ts.map +1 -0
  20. package/dist/get-extension-from-codec.js +33 -0
  21. package/dist/get-extension-from-codec.js.map +1 -0
  22. package/dist/is-local-file.d.ts +2 -0
  23. package/dist/is-local-file.d.ts.map +1 -0
  24. package/dist/is-local-file.js +13 -0
  25. package/dist/is-local-file.js.map +1 -0
  26. package/dist/is-serve-url.d.ts +2 -0
  27. package/dist/is-serve-url.d.ts.map +1 -0
  28. package/dist/is-serve-url.js +13 -0
  29. package/dist/is-serve-url.js.map +1 -0
  30. package/dist/make-assets-download-dir.d.ts +2 -0
  31. package/dist/make-assets-download-dir.d.ts.map +1 -0
  32. package/dist/make-assets-download-dir.js +9 -0
  33. package/dist/make-assets-download-dir.js.map +1 -0
  34. package/dist/normalize-serve-url.d.ts +2 -0
  35. package/dist/normalize-serve-url.d.ts.map +1 -0
  36. package/dist/normalize-serve-url.js +20 -0
  37. package/dist/normalize-serve-url.js.map +1 -0
  38. package/dist/prepare-server.d.ts +5 -0
  39. package/dist/prepare-server.d.ts.map +1 -0
  40. package/dist/prepare-server.js +20 -0
  41. package/dist/prepare-server.js.map +1 -0
  42. package/dist/puppeteer-screenshot.d.ts +0 -1
  43. package/dist/puppeteer-screenshot.d.ts.map +1 -1
  44. package/dist/render-media.d.ts +38 -0
  45. package/dist/render-media.d.ts.map +1 -0
  46. package/dist/render-media.js +146 -0
  47. package/dist/render-media.js.map +1 -0
  48. package/dist/render-video.d.ts +38 -0
  49. package/dist/render-video.d.ts.map +1 -0
  50. package/dist/render-video.js +169 -0
  51. package/dist/render-video.js.map +1 -0
  52. package/dist/sample-rate.d.ts +2 -0
  53. package/dist/sample-rate.d.ts.map +1 -0
  54. package/dist/sample-rate.js +5 -0
  55. package/dist/sample-rate.js.map +1 -0
  56. package/dist/screenshot-dom-element.d.ts +0 -1
  57. package/dist/screenshot-dom-element.d.ts.map +1 -1
  58. package/dist/screenshot-dom-element.js +5 -0
  59. package/dist/screenshot-dom-element.js.map +1 -1
  60. package/dist/screenshot-task.d.ts +0 -1
  61. package/dist/screenshot-task.d.ts.map +1 -1
  62. package/dist/tmp-dir.d.ts +2 -0
  63. package/dist/tmp-dir.d.ts.map +1 -0
  64. package/dist/tmp-dir.js +31 -0
  65. package/dist/tmp-dir.js.map +1 -0
  66. package/package.json +5 -6
@@ -1,2 +1,2 @@
1
- export declare const addSilentAudioIfNecessary: (videoFile: string) => Promise<void>;
1
+ export declare const addSilentAudioIfNecessary: (videoFile: string, durationInFrames: number, fps: number) => Promise<void>;
2
2
  //# sourceMappingURL=add-silent-audio-if-necessary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-silent-audio-if-necessary.d.ts","sourceRoot":"","sources":["../src/add-silent-audio-if-necessary.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB,cAC1B,MAAM,KACf,QAAQ,IAAI,CA+Bd,CAAC"}
1
+ {"version":3,"file":"add-silent-audio-if-necessary.d.ts","sourceRoot":"","sources":["../src/add-silent-audio-if-necessary.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,yBAAyB,cAC1B,MAAM,oBACC,MAAM,OACnB,MAAM,KACT,QAAQ,IAAI,CAkCd,CAAC"}
@@ -7,7 +7,8 @@ exports.addSilentAudioIfNecessary = void 0;
7
7
  const execa_1 = __importDefault(require("execa"));
8
8
  const fs_1 = require("fs");
9
9
  const get_audio_channels_1 = require("./assets/get-audio-channels");
10
- const addSilentAudioIfNecessary = async (videoFile) => {
10
+ const sample_rate_1 = require("./sample-rate");
11
+ const addSilentAudioIfNecessary = async (videoFile, durationInFrames, fps) => {
11
12
  const audioChannels = await (0, get_audio_channels_1.getAudioChannels)(videoFile);
12
13
  if (audioChannels > 0) {
13
14
  return;
@@ -28,8 +29,11 @@ const addSilentAudioIfNecessary = async (videoFile) => {
28
29
  'pcm_s16le',
29
30
  '-c:v',
30
31
  'copy',
32
+ '-ar',
33
+ String(sample_rate_1.DEFAULT_SAMPLE_RATE),
31
34
  '-y',
32
- '-shortest',
35
+ '-t',
36
+ (durationInFrames / fps).toFixed(4),
33
37
  '-f',
34
38
  'matroska',
35
39
  out,
@@ -1 +1 @@
1
- {"version":3,"file":"add-silent-audio-if-necessary.js","sourceRoot":"","sources":["../src/add-silent-audio-if-necessary.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,2BAA0C;AAC1C,oEAA6D;AAEtD,MAAM,yBAAyB,GAAG,KAAK,EAC7C,SAAiB,EACD,EAAE;IAClB,MAAM,aAAa,GAAG,MAAM,IAAA,qCAAgB,EAAC,SAAS,CAAC,CAAC;IACxD,IAAI,aAAa,GAAG,CAAC,EAAE;QACtB,OAAO;KACP;IAED,MAAM,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC;IAE7B,MAAM,IAAA,eAAK,EAAC,QAAQ,EAAE;QACrB,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,UAAU;QACV,IAAI;QACJ,SAAS;QACT,MAAM;QACN,OAAO;QACP,MAAM;QACN,OAAO;QACP,MAAM;QACN,WAAW;QACX,MAAM;QACN,MAAM;QACN,IAAI;QACJ,WAAW;QACX,IAAI;QACJ,UAAU;QACV,GAAG;KACH,CAAC,CAAC;IACH,IAAA,eAAU,EAAC,SAAS,CAAC,CAAC;IACtB,IAAA,eAAU,EAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAC5B,CAAC,CAAC;AAjCW,QAAA,yBAAyB,6BAiCpC"}
1
+ {"version":3,"file":"add-silent-audio-if-necessary.js","sourceRoot":"","sources":["../src/add-silent-audio-if-necessary.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,2BAA0C;AAC1C,oEAA6D;AAC7D,+CAAkD;AAE3C,MAAM,yBAAyB,GAAG,KAAK,EAC7C,SAAiB,EACjB,gBAAwB,EACxB,GAAW,EACK,EAAE;IAClB,MAAM,aAAa,GAAG,MAAM,IAAA,qCAAgB,EAAC,SAAS,CAAC,CAAC;IACxD,IAAI,aAAa,GAAG,CAAC,EAAE;QACtB,OAAO;KACP;IAED,MAAM,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC;IAE7B,MAAM,IAAA,eAAK,EAAC,QAAQ,EAAE;QACrB,IAAI;QACJ,OAAO;QACP,IAAI;QACJ,UAAU;QACV,IAAI;QACJ,SAAS;QACT,MAAM;QACN,OAAO;QACP,MAAM;QACN,OAAO;QACP,MAAM;QACN,WAAW;QACX,MAAM;QACN,MAAM;QACN,KAAK;QACL,MAAM,CAAC,iCAAmB,CAAC;QAC3B,IAAI;QACJ,IAAI;QACJ,CAAC,gBAAgB,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QACnC,IAAI;QACJ,UAAU;QACV,GAAG;KACH,CAAC,CAAC;IACH,IAAA,eAAU,EAAC,SAAS,CAAC,CAAC;IACtB,IAAA,eAAU,EAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAC5B,CAAC,CAAC;AAtCW,QAAA,yBAAyB,6BAsCpC"}
@@ -1,6 +1,9 @@
1
1
  import { FfmpegFilterCalculation } from './calculate-ffmpeg-filters';
2
2
  export declare const createFfmpegComplexFilter: (filters: FfmpegFilterCalculation[]) => Promise<{
3
- complexFilterFlag: [string, string] | null;
3
+ complexFilterFlag: [
4
+ string,
5
+ string
6
+ ] | null;
4
7
  cleanup: () => void;
5
8
  }>;
6
9
  //# sourceMappingURL=create-ffmpeg-complex-filter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-ffmpeg-complex-filter.d.ts","sourceRoot":"","sources":["../src/create-ffmpeg-complex-filter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAC;AAmBnE,eAAO,MAAM,yBAAyB,YAC5B,uBAAuB,EAAE,KAChC,QAAQ;IACV,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB,CA2BA,CAAC"}
1
+ {"version":3,"file":"create-ffmpeg-complex-filter.d.ts","sourceRoot":"","sources":["../src/create-ffmpeg-complex-filter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAC;AAmBnE,eAAO,MAAM,yBAAyB,YAC5B,uBAAuB,EAAE,KAChC,QAAQ;IACV,iBAAiB,EAAE;QAAC,MAAM;QAAE,MAAM;KAAC,GAAG,IAAI,CAAC;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB,CA2BA,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const deleteDirectory: (directory: string) => Promise<void>;
2
+ //# sourceMappingURL=delete-directory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-directory.d.ts","sourceRoot":"","sources":["../src/delete-directory.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,cAAqB,MAAM,KAAG,QAAQ,IAAI,CAerE,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.deleteDirectory = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const execa_1 = __importDefault(require("execa"));
9
+ const is_serve_url_1 = require("./is-serve-url");
10
+ const deleteDirectory = async (directory) => {
11
+ var _a;
12
+ if ((0, is_serve_url_1.isServeUrl)(directory)) {
13
+ return;
14
+ }
15
+ if (process.platform === 'win32') {
16
+ // We use del before to remove all files inside the directories otherwise
17
+ // rmdir will throw an error.
18
+ await (0, execa_1.default)('cmd', ['/c', 'del', '/f', '/s', '/q', directory]);
19
+ await (0, execa_1.default)('cmd', ['/c', 'rmdir', '/s', '/q', directory]);
20
+ }
21
+ else {
22
+ await ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(directory, {
23
+ recursive: true,
24
+ });
25
+ }
26
+ };
27
+ exports.deleteDirectory = deleteDirectory;
28
+ //# sourceMappingURL=delete-directory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-directory.js","sourceRoot":"","sources":["../src/delete-directory.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,kDAA0B;AAC1B,iDAA0C;AAEnC,MAAM,eAAe,GAAG,KAAK,EAAE,SAAiB,EAAiB,EAAE;;IACzE,IAAI,IAAA,yBAAU,EAAC,SAAS,CAAC,EAAE;QAC1B,OAAO;KACP;IAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QACjC,yEAAyE;QACzE,6BAA6B;QAC7B,MAAM,IAAA,eAAK,EAAC,KAAK,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QAC/D,MAAM,IAAA,eAAK,EAAC,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;KAC3D;SAAM;QACN,MAAM,CAAC,MAAA,YAAE,CAAC,QAAQ,CAAC,EAAE,mCAAI,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE;YACtD,SAAS,EAAE,IAAI;SACf,CAAC,CAAC;KACH;AACF,CAAC,CAAC;AAfW,QAAA,eAAe,mBAe1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"ffmpeg-flags.d.ts","sourceRoot":"","sources":["../src/ffmpeg-flags.ts"],"names":[],"mappings":"AAKA,oBAAY,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5D,eAAO,MAAM,kBAAkB,YAAmB;IACjD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,oBAUA,CAAC;AAEF,eAAO,MAAM,gBAAgB,qBACV,MAAM,GAAG,IAAI,WACtB,YAAY,GAAG,gBAAgB,GAAG,eAAe,qBAQ1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,cAAe,MAAM,KAAG,aAStD,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAAmB;IAC/C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,KAAG,QAAQ,aAAa,CAKxB,CAAC"}
1
+ {"version":3,"file":"ffmpeg-flags.d.ts","sourceRoot":"","sources":["../src/ffmpeg-flags.ts"],"names":[],"mappings":"AAKA,oBAAY,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5D,eAAO,MAAM,kBAAkB,YAAmB;IACjD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,oBAcA,CAAC;AAEF,eAAO,MAAM,gBAAgB,qBACV,MAAM,GAAG,IAAI,WACtB,YAAY,GAAG,gBAAgB,GAAG,eAAe,qBAQ1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,cAAe,MAAM,KAAG,aAStD,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAAmB;IAC/C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,KAAG,QAAQ,aAAa,CAKxB,CAAC"}
@@ -12,9 +12,9 @@ const getFfmpegBuildInfo = async (options) => {
12
12
  if (buildConfig !== null) {
13
13
  return buildConfig;
14
14
  }
15
- const data = await (0, execa_1.default)((_a = options.ffmpegExecutable) !== null && _a !== void 0 ? _a : 'ffmpeg', [
16
- '-buildconf',
17
- ]);
15
+ const data = await (0, execa_1.default)((_a = options.ffmpegExecutable) !== null && _a !== void 0 ? _a : 'ffmpeg', ['-buildconf'], {
16
+ reject: false,
17
+ });
18
18
  buildConfig = data.stderr;
19
19
  return buildConfig;
20
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ffmpeg-flags.js","sourceRoot":"","sources":["../src/ffmpeg-flags.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,uDAA+C;AAE/C,IAAI,WAAW,GAAkB,IAAI,CAAC;AAI/B,MAAM,kBAAkB,GAAG,KAAK,EAAE,OAExC,EAAE,EAAE;;IACJ,IAAI,WAAW,KAAK,IAAI,EAAE;QACzB,OAAO,WAAW,CAAC;KACnB;IAED,MAAM,IAAI,GAAG,MAAM,IAAA,eAAK,EAAC,MAAA,OAAO,CAAC,gBAAgB,mCAAI,QAAQ,EAAE;QAC9D,YAAY;KACZ,CAAC,CAAC;IACH,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC;IAC1B,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAZW,QAAA,kBAAkB,sBAY7B;AAEK,MAAM,gBAAgB,GAAG,KAAK,EACpC,gBAA+B,EAC/B,OAA0D,EACzD,EAAE;IACH,IAAI,CAAC,CAAC,MAAM,IAAA,8B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H,OAAO,IAAA,0BAAkB,EAAC,SAAS,CAAC,CAAC;AACtC,CAAC,CAAC;AAPW,QAAA,gBAAgB,oBAO3B"}
@@ -0,0 +1,10 @@
1
+ import { Browser, Page } from 'puppeteer-core';
2
+ import { BrowserExecutable } from 'remotion';
3
+ export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable, }: {
4
+ passedInInstance: Browser | undefined;
5
+ browserExecutable: BrowserExecutable | null;
6
+ }) => Promise<{
7
+ cleanup: () => void;
8
+ page: Page;
9
+ }>;
10
+ //# sourceMappingURL=get-browser-instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-browser-instance.d.ts","sourceRoot":"","sources":["../src/get-browser-instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,iBAAiB,EAAY,MAAM,UAAU,CAAC;AAGtD,eAAO,MAAM,mBAAmB;sBAIb,OAAO,GAAG,SAAS;uBAClB,iBAAiB,GAAG,IAAI;MACxC,QAAQ;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;CACX,CA6BA,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPageAndCleanupFn = void 0;
4
+ const remotion_1 = require("remotion");
5
+ const open_browser_1 = require("./open-browser");
6
+ const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, }) => {
7
+ if (passedInInstance) {
8
+ const page = await passedInInstance.newPage();
9
+ return {
10
+ page,
11
+ cleanup: () => {
12
+ // Close puppeteer page and don't wait for it to finish.
13
+ // Keep browser open.
14
+ page.close().catch((err) => {
15
+ console.error('Was not able to close puppeteer page', err);
16
+ });
17
+ },
18
+ };
19
+ }
20
+ const browserInstance = await (0, open_browser_1.openBrowser)(remotion_1.Internals.DEFAULT_BROWSER, {
21
+ browserExecutable,
22
+ });
23
+ const browserPage = await browserInstance.newPage();
24
+ return {
25
+ page: browserPage,
26
+ cleanup: () => {
27
+ // Close whole browser that was just created and don't wait for it to finish.
28
+ browserInstance.close().catch((err) => {
29
+ console.error('Was not able to close puppeteer page', err);
30
+ });
31
+ },
32
+ };
33
+ };
34
+ exports.getPageAndCleanupFn = getPageAndCleanupFn;
35
+ //# sourceMappingURL=get-browser-instance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-browser-instance.js","sourceRoot":"","sources":["../src/get-browser-instance.ts"],"names":[],"mappings":";;;AACA,uCAAsD;AACtD,iDAA2C;AAEpC,MAAM,mBAAmB,GAAG,KAAK,EAAE,EACzC,gBAAgB,EAChB,iBAAiB,GAIjB,EAGE,EAAE;IACJ,IAAI,gBAAgB,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAC9C,OAAO;YACN,IAAI;YACJ,OAAO,EAAE,GAAG,EAAE;gBACb,wDAAwD;gBACxD,qBAAqB;gBACrB,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;oBAC1B,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAC;gBAC5D,CAAC,CAAC,CAAC;YACJ,CAAC;SACD,CAAC;KACF;IAED,MAAM,eAAe,GAAG,MAAM,IAAA,0BAAW,EAAC,oBAAS,CAAC,eAAe,EAAE;QACpE,iBAAiB;KACjB,CAAC,CAAC;IACH,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,CAAC;IAEpD,OAAO;QACN,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,GAAG,EAAE;YACb,6EAA6E;YAC7E,eAAe,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBACrC,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC,CAAC;AAtCW,QAAA,mBAAmB,uBAsC9B"}
@@ -0,0 +1,3 @@
1
+ import { Codec } from 'remotion';
2
+ export declare const getFileExtensionFromCodec: (codec: Codec, type: 'chunk' | 'final') => "mp3" | "aac" | "wav" | "mp4" | "mkv" | "mov" | "webm";
3
+ //# sourceMappingURL=get-extension-from-codec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-extension-from-codec.d.ts","sourceRoot":"","sources":["../src/get-extension-from-codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAE/B,eAAO,MAAM,yBAAyB,UAC9B,KAAK,QACN,OAAO,GAAG,OAAO,2DAgCvB,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFileExtensionFromCodec = void 0;
4
+ const getFileExtensionFromCodec = (codec, type) => {
5
+ switch (codec) {
6
+ case 'aac':
7
+ return 'aac';
8
+ case 'h264':
9
+ return 'mp4';
10
+ // The chunks will be rendered as mkv, but the final output will still be MP4
11
+ case 'h264-mkv':
12
+ if (type === 'chunk') {
13
+ return 'mkv';
14
+ }
15
+ return 'mp4';
16
+ case 'h265':
17
+ return 'mp4';
18
+ case 'mp3':
19
+ return 'mp3';
20
+ case 'prores':
21
+ return 'mov';
22
+ case 'vp8':
23
+ return 'webm';
24
+ case 'vp9':
25
+ return 'webm';
26
+ case 'wav':
27
+ return 'wav';
28
+ default:
29
+ throw new Error("Don't know which file extension to use for codec " + codec);
30
+ }
31
+ };
32
+ exports.getFileExtensionFromCodec = getFileExtensionFromCodec;
33
+ //# sourceMappingURL=get-extension-from-codec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-extension-from-codec.js","sourceRoot":"","sources":["../src/get-extension-from-codec.ts"],"names":[],"mappings":";;;AAEO,MAAM,yBAAyB,GAAG,CACxC,KAAY,EACZ,IAAuB,EACtB,EAAE;IACH,QAAQ,KAAK,EAAE;QACd,KAAK,KAAK;YACT,OAAO,KAAK,CAAC;QACd,KAAK,MAAM;YACV,OAAO,KAAK,CAAC;QACd,6EAA6E;QAC7E,KAAK,UAAU;YACd,IAAI,IAAI,KAAK,OAAO,EAAE;gBACrB,OAAO,KAAK,CAAC;aACb;YAED,OAAO,KAAK,CAAC;QAEd,KAAK,MAAM;YACV,OAAO,KAAK,CAAC;QACd,KAAK,KAAK;YACT,OAAO,KAAK,CAAC;QACd,KAAK,QAAQ;YACZ,OAAO,KAAK,CAAC;QACd,KAAK,KAAK;YACT,OAAO,MAAM,CAAC;QACf,KAAK,KAAK;YACT,OAAO,MAAM,CAAC;QACf,KAAK,KAAK;YACT,OAAO,KAAK,CAAC;QACd;YACC,MAAM,IAAI,KAAK,CACd,mDAAmD,GAAG,KAAK,CAC3D,CAAC;KACH;AACF,CAAC,CAAC;AAlCW,QAAA,yBAAyB,6BAkCpC"}
@@ -0,0 +1,2 @@
1
+ export declare const isServeUrl: (potentialUrl: string) => boolean;
2
+ //# sourceMappingURL=is-local-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-local-file.d.ts","sourceRoot":"","sources":["../src/is-local-file.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,iBAAkB,MAAM,YAY9C,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isServeUrl = void 0;
4
+ const isServeUrl = (potentialUrl) => {
5
+ // Theoretically not a valid URL but handle the most basic cases of forgetting protocol in front
6
+ if (potentialUrl.startsWith('www.') ||
7
+ potentialUrl.includes('amazonaws.com')) {
8
+ return true;
9
+ }
10
+ return (potentialUrl.startsWith('https://') || !potentialUrl.startsWith('http://'));
11
+ };
12
+ exports.isServeUrl = isServeUrl;
13
+ //# sourceMappingURL=is-local-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-local-file.js","sourceRoot":"","sources":["../src/is-local-file.ts"],"names":[],"mappings":";;;AAAO,MAAM,UAAU,GAAG,CAAC,YAAoB,EAAE,EAAE;IAClD,gGAAgG;IAChG,IACC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC;QAC/B,YAAY,CAAC,QAAQ,CAAC,eAAe,CAAC,EACrC;QACD,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,CACN,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAC1E,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB"}
@@ -0,0 +1,2 @@
1
+ export declare const isServeUrl: (potentialUrl: string) => boolean;
2
+ //# sourceMappingURL=is-serve-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-serve-url.d.ts","sourceRoot":"","sources":["../src/is-serve-url.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,iBAAkB,MAAM,YAY9C,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isServeUrl = void 0;
4
+ const isServeUrl = (potentialUrl) => {
5
+ // Theoretically not a valid URL but handle the most basic cases of forgetting protocol in front
6
+ if (potentialUrl.startsWith('www.') ||
7
+ potentialUrl.includes('amazonaws.com')) {
8
+ return true;
9
+ }
10
+ return (potentialUrl.startsWith('https://') || !potentialUrl.startsWith('http://'));
11
+ };
12
+ exports.isServeUrl = isServeUrl;
13
+ //# sourceMappingURL=is-serve-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-serve-url.js","sourceRoot":"","sources":["../src/is-serve-url.ts"],"names":[],"mappings":";;;AAAO,MAAM,UAAU,GAAG,CAAC,YAAoB,EAAE,EAAE;IAClD,gGAAgG;IAChG,IACC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC;QAC/B,YAAY,CAAC,QAAQ,CAAC,eAAe,CAAC,EACrC;QACD,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,CACN,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAC1E,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB"}
@@ -0,0 +1,2 @@
1
+ export declare const makeAssetsDownloadTmpDir: () => string;
2
+ //# sourceMappingURL=make-assets-download-dir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"make-assets-download-dir.d.ts","sourceRoot":"","sources":["../src/make-assets-download-dir.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,QAAO,MAE3C,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeAssetsDownloadTmpDir = void 0;
4
+ const tmp_dir_1 = require("./tmp-dir");
5
+ const makeAssetsDownloadTmpDir = () => {
6
+ return (0, tmp_dir_1.tmpDir)('remotion-assets-dir');
7
+ };
8
+ exports.makeAssetsDownloadTmpDir = makeAssetsDownloadTmpDir;
9
+ //# sourceMappingURL=make-assets-download-dir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"make-assets-download-dir.js","sourceRoot":"","sources":["../src/make-assets-download-dir.ts"],"names":[],"mappings":";;;AAAA,uCAAiC;AAE1B,MAAM,wBAAwB,GAAG,GAAW,EAAE;IACpD,OAAO,IAAA,gBAAM,EAAC,qBAAqB,CAAC,CAAC;AACtC,CAAC,CAAC;AAFW,QAAA,wBAAwB,4BAEnC"}
@@ -0,0 +1,2 @@
1
+ export declare const normalizeServeUrl: (unnormalized: string) => string;
2
+ //# sourceMappingURL=normalize-serve-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-serve-url.d.ts","sourceRoot":"","sources":["../src/normalize-serve-url.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,iBAAkB,MAAM,KAAG,MAmBxD,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeServeUrl = void 0;
4
+ const normalizeServeUrl = (unnormalized) => {
5
+ const hasQuery = unnormalized.includes('?');
6
+ if (hasQuery) {
7
+ return (0, exports.normalizeServeUrl)(unnormalized.substr(0, unnormalized.indexOf('?')));
8
+ }
9
+ const endsInIndexHtml = unnormalized.endsWith('index.html');
10
+ if (endsInIndexHtml) {
11
+ return unnormalized;
12
+ }
13
+ // Ends with slash
14
+ if (unnormalized.endsWith('/')) {
15
+ return `${unnormalized}index.html`;
16
+ }
17
+ return `${unnormalized}/index.html`;
18
+ };
19
+ exports.normalizeServeUrl = normalizeServeUrl;
20
+ //# sourceMappingURL=normalize-serve-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-serve-url.js","sourceRoot":"","sources":["../src/normalize-serve-url.ts"],"names":[],"mappings":";;;AAAO,MAAM,iBAAiB,GAAG,CAAC,YAAoB,EAAU,EAAE;IACjE,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAE5C,IAAI,QAAQ,EAAE;QACb,OAAO,IAAA,yBAAiB,EAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAC5E;IAED,MAAM,eAAe,GAAG,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC5D,IAAI,eAAe,EAAE;QACpB,OAAO,YAAY,CAAC;KACpB;IAED,kBAAkB;IAElB,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC/B,OAAO,GAAG,YAAY,YAAY,CAAC;KACnC;IAED,OAAO,GAAG,YAAY,aAAa,CAAC;AACrC,CAAC,CAAC;AAnBW,QAAA,iBAAiB,qBAmB5B"}
@@ -0,0 +1,5 @@
1
+ export declare const prepareServer: (webpackConfigOrServeUrl: string) => Promise<{
2
+ serveUrl: string;
3
+ closeServer: () => Promise<void>;
4
+ }>;
5
+ //# sourceMappingURL=prepare-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepare-server.d.ts","sourceRoot":"","sources":["../src/prepare-server.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,4BACA,MAAM,KAC7B,QAAQ;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,QAAQ,IAAI,CAAC,CAAC;CACjC,CAaA,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prepareServer = void 0;
4
+ const is_serve_url_1 = require("./is-serve-url");
5
+ const serve_static_1 = require("./serve-static");
6
+ const prepareServer = async (webpackConfigOrServeUrl) => {
7
+ if ((0, is_serve_url_1.isServeUrl)(webpackConfigOrServeUrl)) {
8
+ return Promise.resolve({
9
+ serveUrl: webpackConfigOrServeUrl,
10
+ closeServer: () => Promise.resolve(undefined),
11
+ });
12
+ }
13
+ const { port, close } = await (0, serve_static_1.serveStatic)(webpackConfigOrServeUrl);
14
+ return Promise.resolve({
15
+ closeServer: () => close(),
16
+ serveUrl: `http://localhost:${port}`,
17
+ });
18
+ };
19
+ exports.prepareServer = prepareServer;
20
+ //# sourceMappingURL=prepare-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepare-server.js","sourceRoot":"","sources":["../src/prepare-server.ts"],"names":[],"mappings":";;;AAAA,iDAA0C;AAC1C,iDAA2C;AAEpC,MAAM,aAAa,GAAG,KAAK,EACjC,uBAA+B,EAI7B,EAAE;IACJ,IAAI,IAAA,yBAAU,EAAC,uBAAuB,CAAC,EAAE;QACxC,OAAO,OAAO,CAAC,OAAO,CAAC;YACtB,QAAQ,EAAE,uBAAuB;YACjC,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;SAC7C,CAAC,CAAC;KACH;IAED,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAA,0BAAW,EAAC,uBAAuB,CAAC,CAAC;IACjE,OAAO,OAAO,CAAC,OAAO,CAAC;QACtB,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE;QAC1B,QAAQ,EAAE,oBAAoB,IAAI,EAAE;KACpC,CAAC,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,aAAa,iBAkBxB"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Page, ScreenshotOptions } from 'puppeteer-core';
3
2
  export declare const screenshot: (page: Page, options?: ScreenshotOptions) => Promise<Buffer | string | void>;
4
3
  //# sourceMappingURL=puppeteer-screenshot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"puppeteer-screenshot.d.ts","sourceRoot":"","sources":["../src/puppeteer-screenshot.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,IAAI,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAGvD,eAAO,MAAM,UAAU,SAChB,IAAI,YACD,iBAAiB,KACxB,QAAQ,MAAM,GAAG,MAAM,GAAG,IAAI,CAyFhC,CAAC"}
1
+ {"version":3,"file":"puppeteer-screenshot.d.ts","sourceRoot":"","sources":["../src/puppeteer-screenshot.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAGvD,eAAO,MAAM,UAAU,SAChB,IAAI,YACD,iBAAiB,KACxB,QAAQ,MAAM,GAAG,MAAM,GAAG,IAAI,CAyFhC,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { Browser as PuppeteerBrowser } from 'puppeteer-core';
2
+ import { Codec, FfmpegExecutable, FrameRange, PixelFormat, ProResProfile, TCompMetadata } from 'remotion';
3
+ import { BrowserLog } from './browser-log';
4
+ import { OnStartData } from './types';
5
+ import { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
6
+ export declare type StitchingState = 'encoding' | 'muxing';
7
+ export declare type RenderMediaOnProgress = (progress: {
8
+ renderedFrames: number;
9
+ encodedFrames: number;
10
+ encodedDoneIn: number | null;
11
+ renderedDoneIn: number | null;
12
+ stitchStage: StitchingState;
13
+ }) => void;
14
+ export declare type RenderMediaOptions = {
15
+ serveUrl: string;
16
+ outputLocation: string;
17
+ codec: Codec;
18
+ config: TCompMetadata;
19
+ inputProps?: unknown;
20
+ parallelism?: number | null;
21
+ crf?: number | null;
22
+ imageFormat?: 'png' | 'jpeg' | 'none';
23
+ ffmpegExecutable?: FfmpegExecutable;
24
+ pixelFormat?: PixelFormat;
25
+ envVariables?: Record<string, string>;
26
+ quality?: number;
27
+ frameRange?: FrameRange | null;
28
+ puppeteerInstance?: PuppeteerBrowser;
29
+ overwrite?: boolean;
30
+ onProgress?: RenderMediaOnProgress;
31
+ onDownload?: RenderMediaOnDownload;
32
+ proResProfile?: ProResProfile;
33
+ dumpBrowserLogs?: boolean;
34
+ onBrowserLog?: ((log: BrowserLog) => void) | undefined;
35
+ onStart?: (data: OnStartData) => void;
36
+ };
37
+ export declare const renderMedia: ({ parallelism, proResProfile, crf, config, imageFormat, ffmpegExecutable, inputProps, pixelFormat, codec, envVariables, quality, frameRange, serveUrl, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, }: RenderMediaOptions) => Promise<void>;
38
+ //# sourceMappingURL=render-media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-media.d.ts","sourceRoot":"","sources":["../src/render-media.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACN,KAAK,EACL,gBAAgB,EAChB,UAAU,EAEV,WAAW,EACX,aAAa,EACb,aAAa,EACb,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,WAAW,EAAC,MAA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AAI,CAAC,GAAG,SAAS,CAAC;IACvD,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;CACtC,CAAC;AAIF,eAAO,MAAM,WAAW,2QAsBrB,kBAAkB,kBA4IpB,CAAC"}
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.renderMedia = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const remotion_1 = require("remotion");
10
+ const stitcher_1 = require("./stitcher");
11
+ const render_1 = require("./render");
12
+ const tmp_dir_1 = require("./tmp-dir");
13
+ const get_extension_from_codec_1 = require("./get-extension-from-codec");
14
+ const delete_directory_1 = require("./delete-directory");
15
+ const renderMedia = async ({ parallelism, proResProfile, crf, config, imageFormat, ffmpegExecutable, inputProps, pixelFormat, codec, envVariables, quality, frameRange, serveUrl, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, }) => {
16
+ var _a, _b;
17
+ remotion_1.Internals.validateQuality(quality);
18
+ if (typeof crf !== 'undefined') {
19
+ remotion_1.Internals.validateSelectedCrfAndCodecCombination(crf, codec);
20
+ }
21
+ let stitchStage = 'encoding';
22
+ let stitcherFfmpeg;
23
+ let preStitcher = null;
24
+ let encodedFrames = 0;
25
+ let renderedFrames = 0;
26
+ let renderedDoneIn = null;
27
+ let encodedDoneIn = null;
28
+ const renderStart = Date.now();
29
+ const tmpdir = (0, tmp_dir_1.tmpDir)('pre-encode');
30
+ const outputDir = (0, tmp_dir_1.tmpDir)('frames ' + Math.random());
31
+ const parallelEncoding = !remotion_1.Internals.isAudioCodec(codec);
32
+ const preEncodedFileLocation = parallelEncoding
33
+ ? path_1.default.join(tmpdir, 'pre-encode.' + (0, get_extension_from_codec_1.getFileExtensionFromCodec)(codec, 'chunk'))
34
+ : null;
35
+ try {
36
+ const callUpdate = () => {
37
+ onProgress === null || onProgress === void 0 ? void 0 : onProgress({
38
+ encodedDoneIn,
39
+ encodedFrames,
40
+ renderedDoneIn,
41
+ renderedFrames,
42
+ stitchStage,
43
+ });
44
+ };
45
+ if (preEncodedFileLocation) {
46
+ preStitcher = await (0, stitcher_1.spawnFfmpeg)({
47
+ dir: outputDir,
48
+ width: config.width,
49
+ height: config.height,
50
+ fps: config.fps,
51
+ outputLocation: preEncodedFileLocation,
52
+ force: true,
53
+ pixelFormat,
54
+ codec,
55
+ proResProfile,
56
+ crf,
57
+ onProgress: (frame) => {
58
+ encodedFrames = frame;
59
+ callUpdate();
60
+ },
61
+ verbose: remotion_1.Internals.Logging.isEqualOrBelowLogLevel('verbose'),
62
+ parallelEncoding,
63
+ ffmpegExecutable,
64
+ assetsInfo: null,
65
+ });
66
+ stitcherFfmpeg = preStitcher.task;
67
+ }
68
+ const { assetsInfo } = await (0, render_1.renderFrames)({
69
+ config,
70
+ onFrameUpdate: (frame) => {
71
+ renderedFrames = frame;
72
+ callUpdate();
73
+ },
74
+ parallelism,
75
+ outputDir,
76
+ onStart: (data) => {
77
+ renderedFrames = 0;
78
+ callUpdate();
79
+ onStart === null || onStart === void 0 ? void 0 : onStart(data);
80
+ },
81
+ inputProps,
82
+ envVariables,
83
+ imageFormat: imageFormat !== null && imageFormat !== void 0 ? imageFormat : 'jpeg',
84
+ quality,
85
+ frameRange: frameRange !== null && frameRange !== void 0 ? frameRange : null,
86
+ puppeteerInstance,
87
+ writeFrame: async (buffer) => {
88
+ var _a;
89
+ (_a = stitcherFfmpeg === null || stitcherFfmpeg === void 0 ? void 0 : stitcherFfmpeg.stdin) === null || _a === void 0 ? void 0 : _a.write(buffer);
90
+ },
91
+ serveUrl,
92
+ dumpBrowserLogs,
93
+ onBrowserLog,
94
+ onDownload,
95
+ });
96
+ if (stitcherFfmpeg) {
97
+ (_a = stitcherFfmpeg === null || stitcherFfmpeg === void 0 ? void 0 : stitcherFfmpeg.stdin) === null || _a === void 0 ? void 0 : _a.end();
98
+ await stitcherFfmpeg;
99
+ (_b = preStitcher === null || preStitcher === void 0 ? void 0 : preStitcher.cleanup) === null || _b === void 0 ? void 0 : _b.call(preStitcher);
100
+ }
101
+ renderedDoneIn = Date.now() - renderStart;
102
+ callUpdate();
103
+ const dirName = path_1.default.dirname(outputLocation);
104
+ if (!fs_1.default.existsSync(dirName)) {
105
+ fs_1.default.mkdirSync(dirName, {
106
+ recursive: true,
107
+ });
108
+ }
109
+ const stitchStart = Date.now();
110
+ await (0, stitcher_1.stitchFramesToVideo)({
111
+ dir: outputDir,
112
+ width: config.width,
113
+ height: config.height,
114
+ fps: config.fps,
115
+ outputLocation,
116
+ preEncodedFileLocation,
117
+ force: overwrite !== null && overwrite !== void 0 ? overwrite : remotion_1.Internals.DEFAULT_OVERWRITE,
118
+ pixelFormat,
119
+ codec,
120
+ proResProfile,
121
+ crf,
122
+ assetsInfo,
123
+ ffmpegExecutable,
124
+ onProgress: (frame) => {
125
+ stitchStage = 'muxing';
126
+ encodedFrames = frame;
127
+ callUpdate();
128
+ },
129
+ onDownload,
130
+ verbose: remotion_1.Internals.Logging.isEqualOrBelowLogLevel('verbose'),
131
+ parallelEncoding: false,
132
+ });
133
+ encodedFrames = config.durationInFrames;
134
+ encodedDoneIn = Date.now() - stitchStart;
135
+ callUpdate();
136
+ }
137
+ finally {
138
+ if (preEncodedFileLocation !== null &&
139
+ fs_1.default.existsSync(preEncodedFileLocation)) {
140
+ fs_1.default.unlinkSync(preEncodedFileLocation);
141
+ }
142
+ await (0, delete_directory_1.deleteDirectory)(outputDir);
143
+ }
144
+ };
145
+ exports.renderMedia = renderMedia;
146
+ //# sourceMappingURL=render-media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-media.js","sourceRoot":"","sources":["../src/render-media.ts"],"names":[],"mappings":";;;;;;AACA,4CAAoB;AACpB,gDAAwB;AAExB,uCAQkB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ACV,gBAAgB;YAChB,UAAU,EAAE,CAAC,KAAa,EAAE,EAAE;gBAC7B,WAAW,GAAG,QAAQ,CAAC;gBACvB,aAAa,GAAG,KAAK,CAAC;gBACtB,UAAU,EAAE,CAAC;YACd,CAAC;YACD,UAAU;YACV,OAAO,EAAE,oBAAS,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,CAAC;YAC5D,gBAAgB,EAAE,KAAK;SACvB,CAAC,CAAC;QACH,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACxC,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC;QACzC,UAAU,EAAE,CAAC;KACb;YAAS;QACT,IACC,sBAAsB,KAAK,IAAI;YAC/B,YAAE,CAAC,UAAU,CAAC,sBAAsB,CAAC,EACpC;YACD,YAAE,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;SACtC;QAED,MAAM,IAAA,kCAAe,EAAC,SAAS,CAAC,CAAC;KACjC;AACF,CAAC,CAAC;AAlKW,QAAA,WAAW,eAkKtB"}
@@ -0,0 +1,38 @@
1
+ import type { Browser as PuppeteerBrowser } from 'puppeteer-core';
2
+ import { Browser, Codec, FfmpegExecutable, FrameRange, PixelFormat, ProResProfile, TCompMetadata } from 'remotion';
3
+ export declare type RenderVideoOnDownload = (src: string) => void;
4
+ export declare type RenderVideoOnProgress = (progress: {
5
+ renderedFrames: number;
6
+ encodedFrames: number;
7
+ encodedDoneIn: number | null;
8
+ renderedDoneIn: number | null;
9
+ stitchStage: 'encoding' | 'muxing';
10
+ }) => void;
11
+ export declare type RenderVideoOptions = {
12
+ proResProfile: ProResProfile | undefined;
13
+ parallelism: number | null;
14
+ parallelEncoding: boolean;
15
+ crf: number | null;
16
+ outputDir: string;
17
+ config: TCompMetadata;
18
+ imageFormat: 'png' | 'jpeg' | 'none';
19
+ ffmpegExecutable: FfmpegExecutable;
20
+ inputProps: object;
21
+ pixelFormat: PixelFormat;
22
+ codec: Codec;
23
+ envVariables: Record<string, string>;
24
+ quality: number | undefined;
25
+ frameRange: FrameRange | null;
26
+ browser: Browser;
27
+ serveUrl: string;
28
+ openedBrowser: PuppeteerBrowser;
29
+ overwrite: boolean;
30
+ absoluteOutputFile: string;
31
+ onProgress: RenderVideoOnProgress;
32
+ shouldOutputImageSequence: boolean;
33
+ fileExtension: string | null;
34
+ bundled: string;
35
+ onDownload: (src: string) => void;
36
+ };
37
+ export declare const renderVideo: ({ parallelism, proResProfile, parallelEncoding, crf, outputDir, config, imageFormat, ffmpegExecutable, inputProps, pixelFormat, codec, envVariables, quality, frameRange, browser, serveUrl, openedBrowser, absoluteOutputFile, onProgress, overwrite, shouldOutputImageSequence, fileExtension, bundled, onDownload, }: RenderVideoOptions) => Promise<void>;
38
+ //# sourceMappingURL=render-video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-video.d.ts","sourceRoot":"","sources":["../src/render-video.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACN,OAAO,EACP,KAAK,EACL,gBAAgB,EAChB,UAAU,EAEV,WAAW,EACX,aAAa,EACb,aAAa,EACb,MAAM,UAAU,CAAC;AAIlB,oBAAY,qBAAqB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AAE1D,oBAAY,qBAAqB,GAAG,CAAC,QAAQ,EAAE;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,UAAU,GAAG,QAAQ,CAAC;CACnC,KAAK,IAAI,CAAC;AAEX,oBAAY,kBAAkB,GAAG;IAChC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,WAAW,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACrC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,gBAAgB,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,qBAAqB,CAAC;IAClC,yBAAyB,EAAE,OAAO,CAAC;IACnC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,WAAW,4TAyBrB,kBAAkB,kBAuKpB,CAAC"}
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.renderVideo = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const remotion_1 = require("remotion");
10
+ const stitcher_1 = require("./stitcher");
11
+ const render_1 = require("./render");
12
+ const renderVideo = async ({ parallelism, proResProfile, parallelEncoding, crf, outputDir, config, imageFormat, ffmpegExecutable, inputProps, pixelFormat, codec, envVariables, quality, frameRange, browser, serveUrl, openedBrowser, absoluteOutputFile, onProgress, overwrite, shouldOutputImageSequence, fileExtension, bundled, onDownload, }) => {
13
+ var _a, _b;
14
+ let stitcherFfmpeg;
15
+ let preStitcher;
16
+ let encodedFrames = 0;
17
+ let renderedFrames = 0;
18
+ let preEncodedFileLocation;
19
+ let renderedDoneIn = null;
20
+ let encodedDoneIn = null;
21
+ const renderStart = Date.now();
22
+ if (parallelEncoding) {
23
+ if (typeof crf !== 'number') {
24
+ throw new TypeError('CRF is unexpectedly not a number');
25
+ }
26
+ preEncodedFileLocation = path_1.default.join(outputDir, 'pre-encode.' + fileExtension);
27
+ preStitcher = await (0, stitcher_1.spawnFfmpeg)({
28
+ dir: outputDir,
29
+ width: config.width,
30
+ height: config.height,
31
+ fps: config.fps,
32
+ outputLocation: preEncodedFileLocation,
33
+ force: true,
34
+ imageFormat,
35
+ pixelFormat,
36
+ codec,
37
+ proResProfile,
38
+ crf,
39
+ parallelism,
40
+ onProgress: (frame) => {
41
+ encodedFrames = frame;
42
+ onProgress({
43
+ encodedFrames,
44
+ renderedFrames,
45
+ encodedDoneIn: null,
46
+ renderedDoneIn: null,
47
+ stitchStage: 'encoding',
48
+ });
49
+ },
50
+ verbose: remotion_1.Internals.Logging.isEqualOrBelowLogLevel('verbose'),
51
+ parallelEncoding,
52
+ webpackBundle: bundled,
53
+ ffmpegExecutable,
54
+ assetsInfo: { assets: [] },
55
+ });
56
+ stitcherFfmpeg = preStitcher.task;
57
+ }
58
+ const renderer = (0, render_1.renderFrames)({
59
+ config,
60
+ onFrameUpdate: (frame) => {
61
+ renderedFrames = frame;
62
+ onProgress({
63
+ encodedFrames,
64
+ renderedFrames,
65
+ encodedDoneIn,
66
+ renderedDoneIn,
67
+ stitchStage: 'encoding',
68
+ });
69
+ },
70
+ parallelism,
71
+ parallelEncoding,
72
+ outputDir,
73
+ onStart: () => {
74
+ renderedFrames = 0;
75
+ onProgress({
76
+ encodedDoneIn,
77
+ encodedFrames,
78
+ renderedDoneIn,
79
+ renderedFrames,
80
+ // TODO: Keep a state
81
+ stitchStage: 'encoding',
82
+ });
83
+ },
84
+ inputProps,
85
+ envVariables,
86
+ imageFormat,
87
+ quality,
88
+ browser,
89
+ frameRange: frameRange !== null && frameRange !== void 0 ? frameRange : null,
90
+ puppeteerInstance: openedBrowser,
91
+ writeFrame: async (buffer) => {
92
+ var _a;
93
+ (_a = stitcherFfmpeg === null || stitcherFfmpeg === void 0 ? void 0 : stitcherFfmpeg.stdin) === null || _a === void 0 ? void 0 : _a.write(buffer);
94
+ },
95
+ serveUrl,
96
+ });
97
+ const { assetsInfo } = await renderer;
98
+ if (stitcherFfmpeg) {
99
+ (_a = stitcherFfmpeg === null || stitcherFfmpeg === void 0 ? void 0 : stitcherFfmpeg.stdin) === null || _a === void 0 ? void 0 : _a.end();
100
+ await stitcherFfmpeg;
101
+ (_b = preStitcher === null || preStitcher === void 0 ? void 0 : preStitcher.cleanup) === null || _b === void 0 ? void 0 : _b.call(preStitcher);
102
+ }
103
+ const closeBrowserPromise = openedBrowser.close();
104
+ renderedDoneIn = Date.now() - renderStart;
105
+ onProgress({
106
+ encodedFrames,
107
+ renderedFrames,
108
+ renderedDoneIn,
109
+ encodedDoneIn,
110
+ stitchStage: 'encoding',
111
+ });
112
+ if (process.env.DEBUG) {
113
+ remotion_1.Internals.perf.logPerf();
114
+ }
115
+ if (shouldOutputImageSequence) {
116
+ return;
117
+ }
118
+ if (typeof crf !== 'number') {
119
+ throw new TypeError('CRF is unexpectedly not a number');
120
+ }
121
+ const dirName = path_1.default.dirname(absoluteOutputFile);
122
+ if (!fs_1.default.existsSync(dirName)) {
123
+ fs_1.default.mkdirSync(dirName, {
124
+ recursive: true,
125
+ });
126
+ }
127
+ const stitchStart = Date.now();
128
+ await (0, stitcher_1.stitchFramesToVideo)({
129
+ dir: outputDir,
130
+ width: config.width,
131
+ height: config.height,
132
+ fps: config.fps,
133
+ outputLocation: absoluteOutputFile,
134
+ preEncodedFileLocation,
135
+ force: overwrite,
136
+ imageFormat,
137
+ pixelFormat,
138
+ codec,
139
+ proResProfile,
140
+ crf,
141
+ assetsInfo,
142
+ parallelism,
143
+ ffmpegExecutable,
144
+ onProgress: (frame) => {
145
+ onProgress({
146
+ encodedFrames: frame,
147
+ renderedFrames,
148
+ renderedDoneIn,
149
+ encodedDoneIn,
150
+ stitchStage: 'muxing',
151
+ });
152
+ },
153
+ // TODO: Optimization, Now can download before!
154
+ onDownload,
155
+ webpackBundle: bundled,
156
+ verbose: remotion_1.Internals.Logging.isEqualOrBelowLogLevel('verbose'),
157
+ });
158
+ encodedDoneIn = Date.now() - stitchStart;
159
+ onProgress({
160
+ encodedDoneIn,
161
+ encodedFrames,
162
+ renderedDoneIn,
163
+ renderedFrames,
164
+ stitchStage: 'muxing',
165
+ });
166
+ await closeBrowserPromise;
167
+ };
168
+ exports.renderVideo = renderVideo;
169
+ //# sourceMappingURL=render-video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-video.js","sourceRoot":"","sources":["../src/render-video.ts"],"names":[],"mappings":";;;;;;AACA,4CAAoB;AACpB,gDAAwB;AAExB,uCASkB;AAClB,yCAA4D;AAC5D,qCAAsC;AAuC/B,MAAM,WAAW,GAAG,KAAK,EAAE,EACjC,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,GAAG,EACH,SAAS,EACT,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,KAAK,EACL,YAAY,EACZ,OAAO,EACP,UAAU,EACV,OAAO,EACP,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,yBAAyB,EACzB,aAAa,EACb,OAAO,EACP,UAAU,GACU,EAAE,EAAE;;IACxB,IAAI,cAAqD,CAAC;IAC1D,IAAI,WAAW,CAAC;IAChB,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,cAAc,GAAG,CAAC,CAAC;IACv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,QAAQ;KACrB,CAAC,CAAC;IAEH,MAAM,mBAAmB,CAAC;AAC3B,CAAC,CAAC;AAhMW,QAAA,WAAW,eAgMtB"}
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_SAMPLE_RATE = 44100;
2
+ //# sourceMappingURL=sample-rate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sample-rate.d.ts","sourceRoot":"","sources":["../src/sample-rate.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,QAAQ,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_SAMPLE_RATE = void 0;
4
+ exports.DEFAULT_SAMPLE_RATE = 44100;
5
+ //# sourceMappingURL=sample-rate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sample-rate.js","sourceRoot":"","sources":["../src/sample-rate.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,KAAK,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import puppeteer from 'puppeteer-core';
3
2
  import { ImageFormat } from 'remotion';
4
3
  export declare const screenshotDOMElement: ({ page, imageFormat, quality, opts, }: {
@@ -1 +1 @@
1
- {"version":3,"file":"screenshot-dom-element.d.ts","sourceRoot":"","sources":["../src/screenshot-dom-element.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAGrC,eAAO,MAAM,oBAAoB;UAM1B,UAAU,IAAI;iBACP,WAAW;aACf,MAAM,GAAG,SAAS;;;;;MAKxB,QAAQ,MAAM,CAuBjB,CAAC"}
1
+ {"version":3,"file":"screenshot-dom-element.d.ts","sourceRoot":"","sources":["../src/screenshot-dom-element.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAGrC,eAAO,MAAM,oBAAoB;UAM1B,UAAU,IAAI;iBACP,WAAW;aACf,MAAM,GAAG,SAAS;;;;;MAKxB,QAAQ,MAAM,CA2BjB,CAAC"}
@@ -14,6 +14,11 @@ const screenshotDOMElement = async ({ page, imageFormat, quality, opts = {}, })
14
14
  document.body.style.background = 'transparent';
15
15
  });
16
16
  }
17
+ else {
18
+ await page.evaluate(() => {
19
+ document.body.style.background = 'black';
20
+ });
21
+ }
17
22
  if (imageFormat === 'none') {
18
23
  throw new TypeError('Tried to make a screenshot with format "none"');
19
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"screenshot-dom-element.js","sourceRoot":"","sources":["../src/screenshot-dom-element.ts"],"names":[],"mappings":";;;AAEA,iEAAkD;AAE3C,MAAM,oBAAoB,GAAG,KAAK,EAAE,EAC1C,IAAI,EACJ,WAAW,EACX,OAAO,EACP,IAAI,GAAG,EAAE,GAST,EAAmB,EAAE;IACrB,MAAM,IAAI,GAAG,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/C,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC;IAExB,IAAI,CAAC,QAAQ;QAAE,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACzD,IAAI,CAAC,IAAI;QAAE,MAAM,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAEjD,IAAI,WAAW,KAAK,KAAK,EAAE;QAC1B,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;YACxB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,aAAa,CAAC;QAChD,CAAC,CAAC,CAAC;KACH;IAED,IAAI,WAAW,KAAK,MAAM,EAAE;QAC3B,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAC;KACrE;IAED,OAAO,IAAA,iCAAU,EAAC,IAAI,EAAE;QACvB,cAAc,EAAE,WAAW,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AxCW,QAAA,oBAAoB,wBAwC/B"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Page, ScreenshotOptions } from 'puppeteer-core';
3
2
  export declare const _screenshotTask: (page: Page, format: 'png' | 'jpeg', options: ScreenshotOptions) => Promise<Buffer | string>;
4
3
  //# sourceMappingURL=screenshot-task.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"screenshot-task.d.ts","sourceRoot":"","sources":["../src/screenshot-task.ts"],"names":[],"mappings":";AACA,OAAO,EAAa,IAAI,EAAE,iBAAiB,EAAS,MAAM,gBAAgB,CAAC;AAG3E,eAAO,MAAM,eAAe,SACrB,IAAI,UACF,KAAK,GAAG,MAAM,WACb,iBAAiB,KACxB,QAAQ,MAAM,GAAG,MAAM,CAqCzB,CAAC"}
1
+ {"version":3,"file":"screenshot-task.d.ts","sourceRoot":"","sources":["../src/screenshot-task.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,IAAI,EAAE,iBAAiB,EAAS,MAAM,gBAAgB,CAAC;AAG3E,eAAO,MAAM,eAAe,SACrB,IAAI,UACF,KAAK,GAAG,MAAM,WACb,iBAAiB,KACxB,QAAQ,MAAM,GAAG,MAAM,CAqCzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const tmpDir: (str: string) => string;
2
+ //# sourceMappingURL=tmp-dir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tmp-dir.d.ts","sourceRoot":"","sources":["../src/tmp-dir.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,MAAM,QAAS,MAAM,WAUjC,CAAC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.tmpDir = void 0;
7
+ const fs_1 = require("fs");
8
+ const os_1 = __importDefault(require("os"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789';
11
+ const randomHash = () => {
12
+ return new Array(10)
13
+ .fill(1)
14
+ .map(() => {
15
+ return alphabet[Math.floor(Math.random() * alphabet.length)];
16
+ })
17
+ .join('');
18
+ };
19
+ const isInLambda = Boolean(process.env.LAMBDA_TASK_ROOT);
20
+ const tmpDir = (str) => {
21
+ if (isInLambda) {
22
+ const dir = '/tmp/' + str + randomHash();
23
+ (0, fs_1.mkdirSync)(dir);
24
+ return dir;
25
+ }
26
+ const newDir = path_1.default.join(os_1.default.tmpdir(), str + randomHash());
27
+ (0, fs_1.mkdirSync)(newDir);
28
+ return newDir;
29
+ };
30
+ exports.tmpDir = tmpDir;
31
+ //# sourceMappingURL=tmp-dir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tmp-dir.js","sourceRoot":"","sources":["../src/tmp-dir.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA6B;AAC7B,4CAAoB;AACpB,gDAAwB;AAExB,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AAExD,MAAM,UAAU,GAAG,GAAW,EAAE;IAC/B,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC;SAClB,IAAI,CAAC,CAAC,CAAC;SACP,GAAG,CAAC,GAAG,EAAE;QACT,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAElD,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE;IACrC,IAAI,UAAU,EAAE;QACf,MAAM,GAAG,GAAG,OAAO,GAAG,GAAG,GAAG,UAAU,EAAE,CAAC;QACzC,IAAA,cAAS,EAAC,GAAG,CAAC,CAAC;QACf,OAAO,GAAG,CAAC;KACX;IAED,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,MAAM,EAAE,EAAE,GAAG,GAAG,UAAU,EAAE,CAAC,CAAC;IAC1D,IAAA,cAAS,EAAC,MAAM,CAAC,CAAC;IAClB,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAVW,QAAA,MAAM,UAUjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "2.5.1",
3
+ "version": "2.5.5-alpha.12+69da85b0e",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,16 +16,15 @@
16
16
  "url": "https://github.com/remotion-dev/remotion"
17
17
  },
18
18
  "dependencies": {
19
- "@remotion/bundler": "^2.5.1",
19
+ "@remotion/bundler": "^2.5.5-alpha.12+69da85b0e",
20
20
  "@testing-library/dom": "^8.7.2",
21
21
  "execa": "^4.0.2",
22
22
  "got": "11.8.2",
23
23
  "p-limit": "^3.1.0",
24
24
  "puppeteer-core": "^10.2.0",
25
- "remotion": "^2.5.1",
25
+ "remotion": "^2.5.5-alpha.12+69da85b0e",
26
26
  "sanitize-filename": "^1.6.3",
27
- "serve-handler": "^6.1.3",
28
- "xns": "^2.0.7"
27
+ "serve-handler": "^6.1.3"
29
28
  },
30
29
  "peerDependencies": {
31
30
  "react": "^17.0.1",
@@ -47,5 +46,5 @@
47
46
  "publishConfig": {
48
47
  "access": "public"
49
48
  },
50
- "gitHead": "88941207249708b9680ffe13448b19da397c564d"
49
+ "gitHead": "69da85b0e5e023e6d587581bbc01aa535930a1b1"
51
50
  }