@remotion/renderer 4.0.0-offthread.34 → 4.0.0-offthread.42

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.
@@ -11,6 +11,7 @@ declare type GetCompositionsConfig = {
11
11
  timeoutInMilliseconds?: number;
12
12
  chromiumOptions?: ChromiumOptions;
13
13
  ffmpegExecutable?: FfmpegExecutable;
14
+ port?: number | null;
14
15
  };
15
16
  export declare const getCompositions: (serveUrlOrWebpackUrl: string, config?: GetCompositionsConfig | undefined) => Promise<TCompMetadata[]>;
16
17
  export {};
@@ -59,7 +59,7 @@ const getCompositions = async (serveUrlOrWebpackUrl, config) => {
59
59
  chromiumOptions: (_b = config === null || config === void 0 ? void 0 : config.chromiumOptions) !== null && _b !== void 0 ? _b : {},
60
60
  });
61
61
  return new Promise((resolve, reject) => {
62
- var _a;
62
+ var _a, _b;
63
63
  const onError = (err) => reject(err);
64
64
  const cleanupPageError = (0, handle_javascript_exception_1.handleJavascriptException)({
65
65
  page,
@@ -73,6 +73,7 @@ const getCompositions = async (serveUrlOrWebpackUrl, config) => {
73
73
  onDownload: () => undefined,
74
74
  onError,
75
75
  ffmpegExecutable: (_a = config === null || config === void 0 ? void 0 : config.ffmpegExecutable) !== null && _a !== void 0 ? _a : null,
76
+ port: (_b = config === null || config === void 0 ? void 0 : config.port) !== null && _b !== void 0 ? _b : null,
76
77
  })
77
78
  .then(({ serveUrl, closeServer, offthreadPort }) => {
78
79
  close = closeServer;
package/dist/index.d.ts CHANGED
@@ -54,17 +54,6 @@ export declare const RenderInternals: {
54
54
  makeAssetsDownloadTmpDir: () => string;
55
55
  tmpDir: (str: string) => string;
56
56
  deleteDirectory: (directory: string) => Promise<void>;
57
- prepareServer: ({ downloadDir, ffmpegExecutable, onDownload, onError, webpackConfigOrServeUrl, }: {
58
- webpackConfigOrServeUrl: string;
59
- downloadDir: string;
60
- onDownload: import("./assets/download-and-map-assets-to-file").RenderMediaOnDownload;
61
- onError: (err: Error) => void;
62
- ffmpegExecutable: import("remotion").FfmpegExecutable;
63
- }) => Promise<{
64
- serveUrl: string;
65
- closeServer: () => Promise<unknown>;
66
- offthreadPort: number;
67
- }>;
68
57
  isServeUrl: (potentialUrl: string) => boolean;
69
58
  ensureOutputDirectory: (outputLocation: string) => void;
70
59
  getRealFrameRange: (durationInFrames: number, frameRange: import("remotion").FrameRange | null) => [number, number];
package/dist/index.js CHANGED
@@ -18,7 +18,6 @@ const make_assets_download_dir_1 = require("./make-assets-download-dir");
18
18
  const normalize_serve_url_1 = require("./normalize-serve-url");
19
19
  const open_browser_1 = require("./open-browser");
20
20
  const parse_browser_error_stack_1 = require("./parse-browser-error-stack");
21
- const prepare_server_1 = require("./prepare-server");
22
21
  const serve_static_1 = require("./serve-static");
23
22
  const stitch_frames_to_video_1 = require("./stitch-frames-to-video");
24
23
  const tmp_dir_1 = require("./tmp-dir");
@@ -58,7 +57,6 @@ exports.RenderInternals = {
58
57
  makeAssetsDownloadTmpDir: make_assets_download_dir_1.makeAssetsDownloadTmpDir,
59
58
  tmpDir: tmp_dir_1.tmpDir,
60
59
  deleteDirectory: delete_directory_1.deleteDirectory,
61
- prepareServer: prepare_server_1.prepareServer,
62
60
  isServeUrl: is_serve_url_1.isServeUrl,
63
61
  ensureOutputDirectory: ensure_output_directory_1.ensureOutputDirectory,
64
62
  getRealFrameRange: get_frame_to_render_1.getRealFrameRange,
@@ -1,11 +1,12 @@
1
1
  import { FfmpegExecutable } from 'remotion';
2
2
  import { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
3
- export declare const prepareServer: ({ downloadDir, ffmpegExecutable, onDownload, onError, webpackConfigOrServeUrl, }: {
3
+ export declare const prepareServer: ({ downloadDir, ffmpegExecutable, onDownload, onError, webpackConfigOrServeUrl, port, }: {
4
4
  webpackConfigOrServeUrl: string;
5
5
  downloadDir: string;
6
6
  onDownload: RenderMediaOnDownload;
7
7
  onError: (err: Error) => void;
8
8
  ffmpegExecutable: FfmpegExecutable;
9
+ port: number | null;
9
10
  }) => Promise<{
10
11
  serveUrl: string;
11
12
  closeServer: () => Promise<unknown>;
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prepareServer = void 0;
4
4
  const is_serve_url_1 = require("./is-serve-url");
5
5
  const serve_static_1 = require("./serve-static");
6
- const prepareServer = async ({ downloadDir, ffmpegExecutable, onDownload, onError, webpackConfigOrServeUrl, }) => {
6
+ const prepareServer = async ({ downloadDir, ffmpegExecutable, onDownload, onError, webpackConfigOrServeUrl, port, }) => {
7
7
  if ((0, is_serve_url_1.isServeUrl)(webpackConfigOrServeUrl)) {
8
8
  const { port: offthreadPort, close: closeProxy } = await (0, serve_static_1.serveStatic)(null, {
9
9
  downloadDir,
10
10
  onDownload,
11
11
  onError,
12
12
  ffmpegExecutable,
13
- port: null,
13
+ port,
14
14
  });
15
15
  return Promise.resolve({
16
16
  serveUrl: webpackConfigOrServeUrl,
@@ -18,19 +18,19 @@ const prepareServer = async ({ downloadDir, ffmpegExecutable, onDownload, onErro
18
18
  offthreadPort,
19
19
  });
20
20
  }
21
- const { port, close } = await (0, serve_static_1.serveStatic)(webpackConfigOrServeUrl, {
21
+ const { port: serverPort, close } = await (0, serve_static_1.serveStatic)(webpackConfigOrServeUrl, {
22
22
  downloadDir,
23
23
  onDownload,
24
24
  onError,
25
25
  ffmpegExecutable,
26
- port: null,
26
+ port,
27
27
  });
28
28
  return Promise.resolve({
29
29
  closeServer: () => {
30
30
  return close();
31
31
  },
32
32
  serveUrl: `http://localhost:${port}`,
33
- offthreadPort: port,
33
+ offthreadPort: serverPort,
34
34
  });
35
35
  };
36
36
  exports.prepareServer = prepareServer;
@@ -34,6 +34,7 @@ declare type RenderFramesOptions = {
34
34
  chromiumOptions?: ChromiumOptions;
35
35
  scale?: number;
36
36
  ffmpegExecutable?: FfmpegExecutable;
37
+ port?: number | null;
37
38
  } & ConfigOrComposition & ServeUrlOrWebpackBundle;
38
39
  export declare const renderFrames: (options: RenderFramesOptions) => Promise<RenderFramesOutput>;
39
40
  export {};
@@ -214,7 +214,7 @@ const renderFrames = async (options) => {
214
214
  const { stopCycling } = (0, cycle_browser_tabs_1.cycleBrowserTabs)(browserInstance, actualParallelism);
215
215
  const openedPages = [];
216
216
  return new Promise((resolve, reject) => {
217
- var _a;
217
+ var _a, _b;
218
218
  let cleanup = null;
219
219
  const onError = (err) => reject(err);
220
220
  (0, prepare_server_1.prepareServer)({
@@ -223,6 +223,7 @@ const renderFrames = async (options) => {
223
223
  onDownload,
224
224
  onError,
225
225
  ffmpegExecutable: (_a = options.ffmpegExecutable) !== null && _a !== void 0 ? _a : null,
226
+ port: (_b = options.port) !== null && _b !== void 0 ? _b : null,
226
227
  })
227
228
  .then(({ serveUrl, closeServer, offthreadPort }) => {
228
229
  cleanup = closeServer;
@@ -1,5 +1,5 @@
1
1
  import type { Browser as PuppeteerBrowser } from 'puppeteer-core';
2
- import { Codec, FfmpegExecutable, FrameRange, PixelFormat, ProResProfile, SmallTCompMetadata } from 'remotion';
2
+ import { BrowserExecutable, Codec, FfmpegExecutable, FrameRange, PixelFormat, ProResProfile, SmallTCompMetadata } from 'remotion';
3
3
  import { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
4
4
  import { BrowserLog } from './browser-log';
5
5
  import { ServeUrlOrWebpackBundle } from './legacy-webpack-config';
@@ -37,5 +37,7 @@ export declare type RenderMediaOptions = {
37
37
  timeoutInMilliseconds?: number;
38
38
  chromiumOptions?: ChromiumOptions;
39
39
  scale?: number;
40
+ port?: number | null;
41
+ browserExecutable?: BrowserExecutable;
40
42
  } & ServeUrlOrWebpackBundle;
41
- export declare const renderMedia: ({ parallelism, proResProfile, crf, composition, imageFormat, ffmpegExecutable, inputProps, pixelFormat, codec, envVariables, quality, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, ...options }: RenderMediaOptions) => Promise<void>;
43
+ export declare const renderMedia: ({ parallelism, proResProfile, crf, composition, imageFormat, ffmpegExecutable, inputProps, pixelFormat, codec, envVariables, quality, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, ...options }: RenderMediaOptions) => Promise<void>;
@@ -23,7 +23,7 @@ const tmp_dir_1 = require("./tmp-dir");
23
23
  const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
24
24
  const validate_output_filename_1 = require("./validate-output-filename");
25
25
  const validate_scale_1 = require("./validate-scale");
26
- const renderMedia = async ({ parallelism, proResProfile, crf, composition, imageFormat, ffmpegExecutable, inputProps, pixelFormat, codec, envVariables, quality, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, ...options }) => {
26
+ const renderMedia = async ({ parallelism, proResProfile, crf, composition, imageFormat, ffmpegExecutable, inputProps, pixelFormat, codec, envVariables, quality, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, ...options }) => {
27
27
  var _a;
28
28
  remotion_1.Internals.validateQuality(quality);
29
29
  if (typeof crf !== 'undefined' && crf !== null) {
@@ -121,8 +121,9 @@ const renderMedia = async ({ parallelism, proResProfile, crf, composition, image
121
121
  timeoutInMilliseconds,
122
122
  chromiumOptions,
123
123
  scale,
124
- // TODO: Document new property for FFMPEG executable
125
124
  ffmpegExecutable,
125
+ browserExecutable,
126
+ port,
126
127
  });
127
128
  if (stitcherFfmpeg) {
128
129
  await waitForFinish();
@@ -21,7 +21,9 @@ declare type InnerStillOptions = {
21
21
  onDownload?: RenderMediaOnDownload;
22
22
  ffmpegExecutable?: FfmpegExecutable;
23
23
  };
24
- declare type RenderStillOptions = InnerStillOptions & ServeUrlOrWebpackBundle;
24
+ declare type RenderStillOptions = InnerStillOptions & ServeUrlOrWebpackBundle & {
25
+ port?: number | null;
26
+ };
25
27
  /**
26
28
  * @description Render a still frame from a composition and returns an image path
27
29
  */
@@ -138,7 +138,7 @@ const renderStill = (options) => {
138
138
  const downloadDir = (0, make_assets_download_dir_1.makeAssetsDownloadTmpDir)();
139
139
  const onDownload = (_a = options.onDownload) !== null && _a !== void 0 ? _a : (() => () => undefined);
140
140
  return new Promise((resolve, reject) => {
141
- var _a;
141
+ var _a, _b;
142
142
  const onError = (err) => reject(err);
143
143
  let close = null;
144
144
  (0, prepare_server_1.prepareServer)({
@@ -147,6 +147,7 @@ const renderStill = (options) => {
147
147
  onDownload,
148
148
  onError,
149
149
  ffmpegExecutable: (_a = options.ffmpegExecutable) !== null && _a !== void 0 ? _a : null,
150
+ port: (_b = options.port) !== null && _b !== void 0 ? _b : null,
150
151
  })
151
152
  .then(({ serveUrl, closeServer, offthreadPort }) => {
152
153
  close = closeServer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.0-offthread.34+5888bc369",
3
+ "version": "4.0.0-offthread.42+5cdecb6d7",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "execa": "5.1.1",
24
24
  "puppeteer-core": "13.5.1",
25
- "remotion": "4.0.0-offthread.34+5888bc369",
25
+ "remotion": "4.0.0-offthread.42+5cdecb6d7",
26
26
  "serve-handler": "6.1.3",
27
27
  "source-map": "^0.8.0-beta.0"
28
28
  },
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "5888bc369ebc9edf6ecb60a7214f01ca4844b3a0"
62
+ "gitHead": "5cdecb6d7971afe3062521d319eb32aac96346f3"
63
63
  }