@remotion/renderer 4.1.0-alpha8 → 4.1.0-alpha9

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.
@@ -1,14 +1,12 @@
1
1
  import type { TAsset } from 'remotion';
2
- import { OffthreadVideoServerEmitter } from '../offthread-video-server';
3
2
  import type { DownloadMap } from './download-map';
4
3
  export type RenderMediaOnDownload = (src: string) => ((progress: {
5
4
  percent: number | null;
6
5
  downloaded: number;
7
6
  totalSize: number | null;
8
7
  }) => void) | undefined | void;
9
- export declare const downloadAsset: ({ src, downloadMap, emitter, }: {
8
+ export declare const downloadAsset: ({ src, downloadMap, }: {
10
9
  src: string;
11
- emitter: OffthreadVideoServerEmitter;
12
10
  downloadMap: DownloadMap;
13
11
  }) => Promise<string>;
14
12
  export declare const markAllAssetsAsDownloaded: (downloadMap: DownloadMap) => void;
@@ -23,4 +21,4 @@ export declare const downloadAndMapAssetsToFileUrl: ({ asset, onDownload, downlo
23
21
  onDownload: RenderMediaOnDownload | null;
24
22
  downloadMap: DownloadMap;
25
23
  }) => Promise<TAsset>;
26
- export declare const attachDownloadListenerToEmitter: (emitter: OffthreadVideoServerEmitter, onDownload: RenderMediaOnDownload | null) => () => void;
24
+ export declare const attachDownloadListenerToEmitter: (downloadMap: DownloadMap, onDownload: RenderMediaOnDownload | null) => () => void;
@@ -33,7 +33,6 @@ const remotion_1 = require("remotion");
33
33
  const compress_assets_1 = require("../compress-assets");
34
34
  const ensure_output_directory_1 = require("../ensure-output-directory");
35
35
  const mime_types_1 = require("../mime-types");
36
- const offthread_video_server_1 = require("../offthread-video-server");
37
36
  const download_file_1 = require("./download-file");
38
37
  const sanitize_filepath_1 = require("./sanitize-filepath");
39
38
  const waitForAssetToBeDownloaded = ({ src, downloadDir, downloadMap, }) => {
@@ -116,7 +115,7 @@ function validateBufferEncoding(potentialEncoding, dataUrl) {
116
115
  throw new TypeError(errMessage);
117
116
  }
118
117
  }
119
- const downloadAsset = async ({ src, downloadMap, emitter, }) => {
118
+ const downloadAsset = async ({ src, downloadMap, }) => {
120
119
  var _a, _b, _c;
121
120
  if ((0, compress_assets_1.isAssetCompressed)(src)) {
122
121
  return src;
@@ -146,7 +145,7 @@ const downloadAsset = async ({ src, downloadMap, emitter, }) => {
146
145
  if (process.env.NODE_ENV === 'test') {
147
146
  console.log('Actually downloading asset', src);
148
147
  }
149
- emitter.dispatchDownload(src);
148
+ downloadMap.emitter.dispatchDownload(src);
150
149
  if (src.startsWith('data:')) {
151
150
  const [assetDetails, assetData] = src.substring('data:'.length).split(',');
152
151
  if (!assetDetails.includes(';')) {
@@ -176,7 +175,7 @@ const downloadAsset = async ({ src, downloadMap, emitter, }) => {
176
175
  const { to } = await (0, download_file_1.downloadFile)({
177
176
  url: src,
178
177
  onProgress: (progress) => {
179
- emitter.dispatchDownloadProgress(src, progress.percent, progress.downloaded, progress.totalSize);
178
+ downloadMap.emitter.dispatchDownloadProgress(src, progress.percent, progress.downloaded, progress.totalSize);
180
179
  },
181
180
  to: (contentDisposition, contentType) => (0, exports.getSanitizedFilenameForAssetUrl)({
182
181
  contentDisposition,
@@ -243,11 +242,9 @@ const getSanitizedFilenameForAssetUrl = ({ src, downloadDir, contentDisposition,
243
242
  };
244
243
  exports.getSanitizedFilenameForAssetUrl = getSanitizedFilenameForAssetUrl;
245
244
  const downloadAndMapAssetsToFileUrl = async ({ asset, onDownload, downloadMap, }) => {
246
- const emitter = new offthread_video_server_1.OffthreadVideoServerEmitter();
247
- const cleanup = (0, exports.attachDownloadListenerToEmitter)(emitter, onDownload);
245
+ const cleanup = (0, exports.attachDownloadListenerToEmitter)(downloadMap, onDownload);
248
246
  const newSrc = await (0, exports.downloadAsset)({
249
247
  src: asset.src,
250
- emitter,
251
248
  downloadMap,
252
249
  });
253
250
  cleanup();
@@ -257,14 +254,21 @@ const downloadAndMapAssetsToFileUrl = async ({ asset, onDownload, downloadMap, }
257
254
  };
258
255
  };
259
256
  exports.downloadAndMapAssetsToFileUrl = downloadAndMapAssetsToFileUrl;
260
- const attachDownloadListenerToEmitter = (emitter, onDownload) => {
257
+ const attachDownloadListenerToEmitter = (downloadMap, onDownload) => {
261
258
  const cleanup = [];
262
259
  if (!onDownload) {
263
260
  return () => undefined;
264
261
  }
265
- const a = emitter.addEventListener('download', ({ detail: { src: initialSrc } }) => {
262
+ if (downloadMap.downloadListeners.includes(onDownload)) {
263
+ return () => undefined;
264
+ }
265
+ downloadMap.downloadListeners.push(onDownload);
266
+ cleanup.push(() => {
267
+ downloadMap.downloadListeners = downloadMap.downloadListeners.filter((l) => l !== onDownload);
268
+ });
269
+ const a = downloadMap.emitter.addEventListener('download', ({ detail: { src: initialSrc } }) => {
266
270
  const progress = onDownload(initialSrc);
267
- const b = emitter.addEventListener('progress', ({ detail: { downloaded, percent, src: progressSrc, totalSize } }) => {
271
+ const b = downloadMap.emitter.addEventListener('progress', ({ detail: { downloaded, percent, src: progressSrc, totalSize } }) => {
268
272
  if (initialSrc === progressSrc) {
269
273
  progress === null || progress === void 0 ? void 0 : progress({ downloaded, percent, totalSize });
270
274
  }
@@ -1,10 +1,14 @@
1
1
  import type { TAsset } from 'remotion';
2
+ import { OffthreadVideoServerEmitter } from '../offthread-video-server';
3
+ import type { RenderMediaOnDownload } from './download-and-map-assets-to-file';
2
4
  export type AudioChannelsAndDurationResultCache = {
3
5
  channels: number;
4
6
  duration: number | null;
5
7
  };
6
8
  export type DownloadMap = {
7
9
  id: string;
10
+ emitter: OffthreadVideoServerEmitter;
11
+ downloadListeners: RenderMediaOnDownload[];
8
12
  isDownloadingMap: {
9
13
  [src: string]: {
10
14
  [downloadDir: string]: boolean;
@@ -31,6 +31,7 @@ const node_fs_1 = __importStar(require("node:fs"));
31
31
  const node_path_1 = __importDefault(require("node:path"));
32
32
  const delete_directory_1 = require("../delete-directory");
33
33
  const tmp_dir_1 = require("../tmp-dir");
34
+ const offthread_video_server_1 = require("../offthread-video-server");
34
35
  const makeAndReturn = (dir, name) => {
35
36
  const p = node_path_1.default.join(dir, name);
36
37
  (0, node_fs_1.mkdirSync)(p);
@@ -51,6 +52,7 @@ const makeDownloadMap = () => {
51
52
  durationOfAssetCache: {},
52
53
  id: String(Math.random()),
53
54
  assetDir: dir,
55
+ downloadListeners: [],
54
56
  downloadDir: makeAndReturn(dir, 'remotion-assets-dir'),
55
57
  complexFilter: makeAndReturn(dir, 'remotion-complex-filter'),
56
58
  preEncode: makeAndReturn(dir, 'pre-encode'),
@@ -59,6 +61,7 @@ const makeDownloadMap = () => {
59
61
  stitchFrames: makeAndReturn(dir, 'remotion-stitch-temp-dir'),
60
62
  compositingDir: makeAndReturn(dir, 'remotion-compositing-temp-dir'),
61
63
  compositorCache: {},
64
+ emitter: new offthread_video_server_1.OffthreadVideoServerEmitter(),
62
65
  };
63
66
  };
64
67
  exports.makeDownloadMap = makeDownloadMap;
@@ -4,6 +4,9 @@ export declare const createFfmpegComplexFilter: ({ filters, downloadMap, }: {
4
4
  filters: PreprocessedAudioTrack[];
5
5
  downloadMap: DownloadMap;
6
6
  }) => Promise<{
7
- complexFilterFlag: [string, string] | null;
7
+ complexFilterFlag: [
8
+ string,
9
+ string
10
+ ] | null;
8
11
  cleanup: () => void;
9
12
  }>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import execa from 'execa';
3
2
  import { HeadlessBrowser } from './browser/Browser';
4
3
  import { SymbolicateableError } from './error-handling/symbolicateable-error';
@@ -43,13 +42,12 @@ export declare const RenderInternals: {
43
42
  downloadMap: import("./assets/download-map").DownloadMap;
44
43
  remotionRoot: string;
45
44
  concurrency: number;
46
- logLevel: "verbose" | "info" | "warn" | "error";
45
+ logLevel: "error" | "verbose" | "info" | "warn";
47
46
  indent: boolean;
48
47
  }) => Promise<{
49
48
  port: number;
50
49
  close: () => Promise<void>;
51
50
  compositor: import("./compositor/compositor").Compositor;
52
- events: import("./offthread-video-server").OffthreadVideoServerEmitter;
53
51
  }>;
54
52
  validateEvenDimensionsWithCodec: ({ width, height, codec, scale, }: {
55
53
  width: number;
@@ -114,8 +112,8 @@ export declare const RenderInternals: {
114
112
  validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
115
113
  DEFAULT_BROWSER: import("./browser").Browser;
116
114
  validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
117
- DEFAULT_OPENGL_RENDERER: "angle" | "swangle" | "egl" | "swiftshader" | null;
118
- validateOpenGlRenderer: (option: "angle" | "swangle" | "egl" | "swiftshader" | null) => "angle" | "swangle" | "egl" | "swiftshader" | null;
115
+ DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | null;
116
+ validateOpenGlRenderer: (option: "swangle" | "angle" | "egl" | "swiftshader" | null) => "swangle" | "angle" | "egl" | "swiftshader" | null;
119
117
  validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
120
118
  DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
121
119
  validateJpegQuality: (q: number | undefined) => void;
@@ -123,7 +121,7 @@ export declare const RenderInternals: {
123
121
  DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
124
122
  isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
125
123
  logLevels: readonly ["verbose", "info", "warn", "error"];
126
- isEqualOrBelowLogLevel: (currentLevel: "verbose" | "info" | "warn" | "error", level: "verbose" | "info" | "warn" | "error") => boolean;
124
+ isEqualOrBelowLogLevel: (currentLevel: "error" | "verbose" | "info" | "warn", level: "error" | "verbose" | "info" | "warn") => boolean;
127
125
  isValidLogLevel: (level: string) => boolean;
128
126
  perf: typeof perf;
129
127
  convertToPositiveFrameIndex: ({ frame, durationInFrames, }: {
@@ -300,8 +298,8 @@ export declare const RenderInternals: {
300
298
  };
301
299
  validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
302
300
  validVideoImageFormats: readonly ["png", "jpeg", "none"];
303
- DEFAULT_STILL_IMAGE_FORMAT: "jpeg" | "png" | "webp" | "pdf";
304
- DEFAULT_VIDEO_IMAGE_FORMAT: "jpeg" | "png" | "none";
301
+ DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
302
+ DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
305
303
  DEFAULT_JPEG_QUALITY: number;
306
304
  chalk: {
307
305
  enabled: () => boolean;
@@ -357,24 +355,24 @@ export declare const RenderInternals: {
357
355
  verbose: (message?: any, ...optionalParams: any[]) => void;
358
356
  verboseAdvanced: (options: {
359
357
  indent: boolean;
360
- logLevel: "verbose" | "info" | "warn" | "error";
358
+ logLevel: "error" | "verbose" | "info" | "warn";
361
359
  } & {
362
360
  tag?: string | undefined;
363
361
  }, message?: any, ...optionalParams: any[]) => void;
364
362
  info: (message?: any, ...optionalParams: any[]) => void;
365
363
  infoAdvanced: (options: {
366
364
  indent: boolean;
367
- logLevel: "verbose" | "info" | "warn" | "error";
365
+ logLevel: "error" | "verbose" | "info" | "warn";
368
366
  }, message?: any, ...optionalParams: any[]) => void;
369
367
  warn: (message?: any, ...optionalParams: any[]) => void;
370
368
  warnAdvanced: (options: {
371
369
  indent: boolean;
372
- logLevel: "verbose" | "info" | "warn" | "error";
370
+ logLevel: "error" | "verbose" | "info" | "warn";
373
371
  }, message?: any, ...optionalParams: any[]) => void;
374
372
  error: (message?: any, ...optionalParams: any[]) => void;
375
373
  };
376
- getLogLevel: () => "verbose" | "info" | "warn" | "error";
377
- setLogLevel: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
374
+ getLogLevel: () => "error" | "verbose" | "info" | "warn";
375
+ setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
378
376
  INDENT_TOKEN: string;
379
377
  isColorSupported: () => boolean;
380
378
  HeadlessBrowser: typeof HeadlessBrowser;
@@ -383,7 +381,7 @@ export declare const RenderInternals: {
383
381
  port: number | null;
384
382
  remotionRoot: string;
385
383
  concurrency: number;
386
- logLevel: "verbose" | "info" | "warn" | "error";
384
+ logLevel: "error" | "verbose" | "info" | "warn";
387
385
  indent: boolean;
388
386
  }) => Promise<import("./prepare-server").RemotionServer>;
389
387
  makeOrReuseServer: (server: import("./prepare-server").RemotionServer | undefined, config: {
@@ -391,7 +389,7 @@ export declare const RenderInternals: {
391
389
  port: number | null;
392
390
  remotionRoot: string;
393
391
  concurrency: number;
394
- logLevel: "verbose" | "info" | "warn" | "error";
392
+ logLevel: "error" | "verbose" | "info" | "warn";
395
393
  indent: boolean;
396
394
  }, { onDownload, onError, }: {
397
395
  onError: (err: Error) => void;
@@ -406,7 +404,7 @@ export declare const RenderInternals: {
406
404
  frame: number;
407
405
  serializedInputPropsWithCustomSchema: string;
408
406
  serializedResolvedPropsWithCustomSchema: string;
409
- imageFormat: "jpeg" | "png" | "webp" | "pdf";
407
+ imageFormat: "png" | "jpeg" | "pdf" | "webp";
410
408
  jpegQuality: number;
411
409
  puppeteerInstance: HeadlessBrowser | null;
412
410
  envVariables: Record<string, string>;
@@ -420,7 +418,7 @@ export declare const RenderInternals: {
420
418
  cancelSignal: import("./make-cancel-signal").CancelSignal | null;
421
419
  indent: boolean;
422
420
  server: import("./prepare-server").RemotionServer | undefined;
423
- logLevel: "verbose" | "info" | "warn" | "error";
421
+ logLevel: "error" | "verbose" | "info" | "warn";
424
422
  serveUrl: string;
425
423
  port: number | null;
426
424
  }) => Promise<{
@@ -433,7 +431,7 @@ export declare const RenderInternals: {
433
431
  viewport: import("./browser/PuppeteerViewport").Viewport | null;
434
432
  indent: boolean;
435
433
  browser: import("./browser").Browser;
436
- logLevel: "verbose" | "info" | "warn" | "error";
434
+ logLevel: "error" | "verbose" | "info" | "warn";
437
435
  }) => Promise<HeadlessBrowser>;
438
436
  internalSelectComposition: (options: {
439
437
  serializedInputPropsWithCustomSchema: string;
@@ -446,7 +444,7 @@ export declare const RenderInternals: {
446
444
  port: number | null;
447
445
  indent: boolean;
448
446
  server: import("./prepare-server").RemotionServer | undefined;
449
- logLevel: "verbose" | "info" | "warn" | "error";
447
+ logLevel: "error" | "verbose" | "info" | "warn";
450
448
  serveUrl: string;
451
449
  id: string;
452
450
  }) => Promise<{
@@ -464,7 +462,7 @@ export declare const RenderInternals: {
464
462
  port: number | null;
465
463
  server: import("./prepare-server").RemotionServer | undefined;
466
464
  indent: boolean;
467
- logLevel: "verbose" | "info" | "warn" | "error";
465
+ logLevel: "error" | "verbose" | "info" | "warn";
468
466
  serveUrlOrWebpackUrl: string;
469
467
  }) => Promise<import("remotion").VideoConfig[]>;
470
468
  internalRenderFrames: ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, }: import("./render-frames").InternalRenderFramesOptions) => Promise<import("./types").RenderFramesOutput>;
@@ -16,7 +16,6 @@ export declare const startOffthreadVideoServer: ({ downloadMap, concurrency, log
16
16
  listener: RequestListener;
17
17
  close: () => Promise<void>;
18
18
  compositor: Compositor;
19
- events: OffthreadVideoServerEmitter;
20
19
  };
21
20
  type DownloadEventPayload = {
22
21
  src: string;
@@ -30,7 +30,6 @@ const extractUrlAndSourceFromUrl = (url) => {
30
30
  };
31
31
  exports.extractUrlAndSourceFromUrl = extractUrlAndSourceFromUrl;
32
32
  const startOffthreadVideoServer = ({ downloadMap, concurrency, logLevel, indent, }) => {
33
- const events = new OffthreadVideoServerEmitter();
34
33
  const compositor = (0, compositor_1.startCompositor)('StartLongRunningProcess', {
35
34
  concurrency,
36
35
  maximum_frame_cache_items: (0, compositor_1.getIdealMaximumFrameCacheItems)(),
@@ -70,7 +69,7 @@ const startOffthreadVideoServer = ({ downloadMap, concurrency, logLevel, indent,
70
69
  return;
71
70
  }
72
71
  let extractStart = Date.now();
73
- (0, download_and_map_assets_to_file_1.downloadAsset)({ src, emitter: events, downloadMap })
72
+ (0, download_and_map_assets_to_file_1.downloadAsset)({ src, downloadMap })
74
73
  .then((to) => {
75
74
  extractStart = Date.now();
76
75
  return compositor.executeCommand('ExtractFrame', {
@@ -95,12 +94,11 @@ const startOffthreadVideoServer = ({ downloadMap, concurrency, logLevel, indent,
95
94
  .catch((err) => {
96
95
  res.writeHead(500);
97
96
  res.end();
98
- events.dispatchError(err);
97
+ downloadMap.emitter.dispatchError(err);
99
98
  console.log('Error occurred', err);
100
99
  });
101
100
  },
102
101
  compositor,
103
- events,
104
102
  };
105
103
  };
106
104
  exports.startOffthreadVideoServer = startOffthreadVideoServer;
@@ -1,7 +1,6 @@
1
1
  import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
2
2
  import type { DownloadMap } from './assets/download-map';
3
3
  import type { Compositor } from './compositor/compositor';
4
- import type { OffthreadVideoServerEmitter } from './offthread-video-server';
5
4
  import type { AnySourceMapConsumer } from './symbolicate-stacktrace';
6
5
  import type { LogLevel } from './log-level';
7
6
  export type RemotionServer = {
@@ -10,7 +9,6 @@ export type RemotionServer = {
10
9
  offthreadPort: number;
11
10
  compositor: Compositor;
12
11
  sourceMap: AnySourceMapConsumer | null;
13
- events: OffthreadVideoServerEmitter;
14
12
  downloadMap: DownloadMap;
15
13
  };
16
14
  type PrepareServerOptions = {
@@ -18,7 +18,7 @@ const prepareServer = async ({ webpackConfigOrServeUrl, port, remotionRoot, conc
18
18
  const downloadMap = (0, download_map_1.makeDownloadMap)();
19
19
  logger_1.Log.verboseAdvanced({ indent, logLevel }, 'Created directory for temporary files', downloadMap.assetDir);
20
20
  if ((0, is_serve_url_1.isServeUrl)(webpackConfigOrServeUrl)) {
21
- const { port: offthreadPort, close: closeProxy, compositor: comp, events, } = await (0, serve_static_1.serveStatic)(null, {
21
+ const { port: offthreadPort, close: closeProxy, compositor: comp, } = await (0, serve_static_1.serveStatic)(null, {
22
22
  port,
23
23
  downloadMap,
24
24
  remotionRoot,
@@ -35,7 +35,6 @@ const prepareServer = async ({ webpackConfigOrServeUrl, port, remotionRoot, conc
35
35
  offthreadPort,
36
36
  compositor: comp,
37
37
  sourceMap: null,
38
- events,
39
38
  downloadMap,
40
39
  });
41
40
  }
@@ -46,7 +45,7 @@ const prepareServer = async ({ webpackConfigOrServeUrl, port, remotionRoot, conc
46
45
  throw new Error(`Tried to serve the Webpack bundle on a HTTP server, but the file ${indexFile} does not exist. Is this a valid path to a Webpack bundle?`);
47
46
  }
48
47
  const sourceMap = (0, symbolicate_stacktrace_1.getSourceMapFromLocalFile)(node_path_1.default.join(webpackConfigOrServeUrl, remotion_1.Internals.bundleName));
49
- const { port: serverPort, close, compositor, events: newEvents, } = await (0, serve_static_1.serveStatic)(webpackConfigOrServeUrl, {
48
+ const { port: serverPort, close, compositor, } = await (0, serve_static_1.serveStatic)(webpackConfigOrServeUrl, {
50
49
  port,
51
50
  downloadMap,
52
51
  remotionRoot,
@@ -67,15 +66,14 @@ const prepareServer = async ({ webpackConfigOrServeUrl, port, remotionRoot, conc
67
66
  offthreadPort: serverPort,
68
67
  compositor,
69
68
  sourceMap: await sourceMap,
70
- events: newEvents,
71
69
  downloadMap,
72
70
  });
73
71
  };
74
72
  exports.prepareServer = prepareServer;
75
73
  const makeOrReuseServer = async (server, config, { onDownload, onError, }) => {
76
74
  if (server) {
77
- const cleanupOnDownload = (0, download_and_map_assets_to_file_1.attachDownloadListenerToEmitter)(server.events, onDownload);
78
- const cleanupError = server.events.addEventListener('error', ({ detail: { error } }) => {
75
+ const cleanupOnDownload = (0, download_and_map_assets_to_file_1.attachDownloadListenerToEmitter)(server.downloadMap, onDownload);
76
+ const cleanupError = server.downloadMap.emitter.addEventListener('error', ({ detail: { error } }) => {
79
77
  onError(error);
80
78
  });
81
79
  return {
@@ -88,8 +86,8 @@ const makeOrReuseServer = async (server, config, { onDownload, onError, }) => {
88
86
  };
89
87
  }
90
88
  const newServer = await (0, exports.prepareServer)(config);
91
- const cleanupOnDownloadNew = (0, download_and_map_assets_to_file_1.attachDownloadListenerToEmitter)(newServer.events, onDownload);
92
- const cleanupErrorNew = newServer.events.addEventListener('error', ({ detail: { error } }) => {
89
+ const cleanupOnDownloadNew = (0, download_and_map_assets_to_file_1.attachDownloadListenerToEmitter)(newServer.downloadMap, onDownload);
90
+ const cleanupErrorNew = newServer.downloadMap.emitter.addEventListener('error', ({ detail: { error } }) => {
93
91
  onError(error);
94
92
  });
95
93
  return {
@@ -340,9 +340,11 @@ const internalRenderFrames = ({ browserExecutable, cancelSignal, chromiumOptions
340
340
  onError,
341
341
  }),
342
342
  browserInstance,
343
- ]).then(([{ server: { serveUrl, offthreadPort, compositor, sourceMap, downloadMap, }, cleanupServer, }, pInstance,]) => {
343
+ ]).then(([{ server: openedServer, cleanupServer }, pInstance]) => {
344
+ const { serveUrl, offthreadPort, compositor, sourceMap, downloadMap } = openedServer;
344
345
  const browserReplacer = (0, replace_browser_1.handleBrowserCrash)(pInstance, logLevel, indent);
345
- cleanup.push((0, cycle_browser_tabs_1.cycleBrowserTabs)(browserReplacer, actualConcurrency, logLevel, indent).stopCycling);
346
+ cleanup.push((0, cycle_browser_tabs_1.cycleBrowserTabs)(browserReplacer, actualConcurrency, logLevel, indent)
347
+ .stopCycling);
346
348
  cleanup.push(() => cleanupServer(false));
347
349
  return innerRenderFrames({
348
350
  onError,
@@ -169,7 +169,7 @@ const serveHandler = async (request, response, config) => {
169
169
  return sendError(absolutePath, response, {
170
170
  statusCode: 404,
171
171
  code: 'not_found',
172
- message: 'The requested path could not be found',
172
+ message: 'The requested path (' + absolutePath + ') could not be found',
173
173
  });
174
174
  }
175
175
  let streamOpts = null;
@@ -1,6 +1,5 @@
1
1
  import type { DownloadMap } from './assets/download-map';
2
2
  import type { Compositor } from './compositor/compositor';
3
- import type { OffthreadVideoServerEmitter } from './offthread-video-server';
4
3
  import type { LogLevel } from './log-level';
5
4
  export declare const serveStatic: (path: string | null, options: {
6
5
  port: number | null;
@@ -13,5 +12,4 @@ export declare const serveStatic: (path: string | null, options: {
13
12
  port: number;
14
13
  close: () => Promise<void>;
15
14
  compositor: Compositor;
16
- events: OffthreadVideoServerEmitter;
17
15
  }>;
@@ -9,7 +9,7 @@ const get_port_1 = require("./get-port");
9
9
  const offthread_video_server_1 = require("./offthread-video-server");
10
10
  const serve_handler_1 = require("./serve-handler");
11
11
  const serveStatic = async (path, options) => {
12
- const { listener: offthreadRequest, close: closeCompositor, compositor, events, } = (0, offthread_video_server_1.startOffthreadVideoServer)({
12
+ const { listener: offthreadRequest, close: closeCompositor, compositor, } = (0, offthread_video_server_1.startOffthreadVideoServer)({
13
13
  downloadMap: options.downloadMap,
14
14
  concurrency: options.concurrency,
15
15
  logLevel: options.logLevel,
@@ -85,7 +85,7 @@ const serveStatic = async (path, options) => {
85
85
  }),
86
86
  ]);
87
87
  };
88
- return { port: selectedPort, close, compositor, events };
88
+ return { port: selectedPort, close, compositor };
89
89
  }
90
90
  catch (err) {
91
91
  if (!(err instanceof Error)) {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
3
2
  import type { RenderAssetInfo } from './assets/download-map';
4
3
  import type { AudioCodec } from './audio-codec';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { TAsset } from 'remotion';
3
2
  import type { DownloadMap } from './assets/download-map';
4
3
  import type { Page } from './browser/BrowserPage';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.1.0-alpha8",
3
+ "version": "4.1.0-alpha9",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "extract-zip": "2.0.1",
19
19
  "source-map": "^0.8.0-beta.0",
20
20
  "ws": "8.7.0",
21
- "remotion": "4.1.0-alpha8"
21
+ "remotion": "4.1.0-alpha9"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=16.8.0",
@@ -42,13 +42,13 @@
42
42
  "zod": "^3.21.4"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@remotion/compositor-linux-arm64-musl": "4.1.0-alpha8",
46
- "@remotion/compositor-darwin-x64": "4.1.0-alpha8",
47
- "@remotion/compositor-linux-x64-musl": "4.1.0-alpha8",
48
- "@remotion/compositor-linux-x64-gnu": "4.1.0-alpha8",
49
- "@remotion/compositor-win32-x64-msvc": "4.1.0-alpha8",
50
- "@remotion/compositor-darwin-arm64": "4.1.0-alpha8",
51
- "@remotion/compositor-linux-arm64-gnu": "4.1.0-alpha8"
45
+ "@remotion/compositor-darwin-x64": "4.1.0-alpha9",
46
+ "@remotion/compositor-darwin-arm64": "4.1.0-alpha9",
47
+ "@remotion/compositor-linux-x64-gnu": "4.1.0-alpha9",
48
+ "@remotion/compositor-linux-arm64-musl": "4.1.0-alpha9",
49
+ "@remotion/compositor-linux-arm64-gnu": "4.1.0-alpha9",
50
+ "@remotion/compositor-win32-x64-msvc": "4.1.0-alpha9",
51
+ "@remotion/compositor-linux-x64-musl": "4.1.0-alpha9"
52
52
  },
53
53
  "keywords": [
54
54
  "remotion",