@remotion/renderer 4.0.221 → 4.0.223

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.
@@ -37,6 +37,7 @@ const downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
37
37
  }, 20000);
38
38
  };
39
39
  refreshTimeout();
40
+ let finishEventSent = false;
40
41
  (0, read_file_1.readFile)(url)
41
42
  .then((res) => {
42
43
  var _a, _b;
@@ -55,11 +56,13 @@ const downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
55
56
  if (rejected) {
56
57
  return;
57
58
  }
58
- onProgress === null || onProgress === void 0 ? void 0 : onProgress({
59
- downloaded,
60
- percent: 1,
61
- totalSize: downloaded,
62
- });
59
+ if (!finishEventSent) {
60
+ onProgress === null || onProgress === void 0 ? void 0 : onProgress({
61
+ downloaded,
62
+ percent: 1,
63
+ totalSize: downloaded,
64
+ });
65
+ }
63
66
  refreshTimeout();
64
67
  return resolveAndFlag({ sizeInBytes: downloaded, to });
65
68
  });
@@ -70,11 +73,15 @@ const downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
70
73
  refreshTimeout();
71
74
  downloaded += d.length;
72
75
  refreshTimeout();
76
+ const percent = totalSize === null ? null : downloaded / totalSize;
73
77
  onProgress === null || onProgress === void 0 ? void 0 : onProgress({
74
78
  downloaded,
75
- percent: totalSize === null ? null : downloaded / totalSize,
79
+ percent,
76
80
  totalSize,
77
81
  });
82
+ if (percent === 1) {
83
+ finishEventSent = true;
84
+ }
78
85
  });
79
86
  res.on('close', () => {
80
87
  if (totalSize !== null && downloaded !== totalSize) {
@@ -9,7 +9,8 @@ const defaultBrowserDownloadProgress = ({ indent, logLevel, api, }) => () => {
9
9
  let lastProgress = 0;
10
10
  return {
11
11
  onProgress: (progress) => {
12
- if (progress.downloadedBytes > lastProgress + 10000000) {
12
+ if (progress.downloadedBytes > lastProgress + 10000000 ||
13
+ progress.percent === 1) {
13
14
  lastProgress = progress.downloadedBytes;
14
15
  logger_1.Log.info({ indent, logLevel }, `Downloading Chrome Headless Shell - ${(0, to_megabytes_1.toMegabytes)(progress.downloadedBytes)}/${(0, to_megabytes_1.toMegabytes)(progress.totalSizeInBytes)}`);
15
16
  }
package/dist/client.d.ts CHANGED
@@ -12,7 +12,7 @@ export declare const BrowserSafeApis: {
12
12
  validPixelFormatsForCodec: (codec: import("./codec").Codec) => readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"] | ("yuv420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le")[];
13
13
  validVideoImageFormats: readonly ["png", "jpeg", "none"];
14
14
  validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
15
- DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
15
+ DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuv422p" | "yuv444p" | "yuva420p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
16
16
  DEFAULT_TIMEOUT: number;
17
17
  DEFAULT_JPEG_QUALITY: number;
18
18
  DEFAULT_COLOR_SPACE: "default";
@@ -412,7 +412,7 @@ export declare const BrowserSafeApis: {
412
412
  source: string;
413
413
  value: import("./options/color-space").ColorSpace;
414
414
  };
415
- setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
415
+ setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
416
416
  };
417
417
  deleteAfterOption: {
418
418
  name: string;
@@ -938,7 +938,7 @@ export declare const BrowserSafeApis: {
938
938
  source: string;
939
939
  value: import("./options/color-space").ColorSpace;
940
940
  };
941
- setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
941
+ setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
942
942
  };
943
943
  readonly codec: {
944
944
  name: string;
@@ -1678,7 +1678,7 @@ export declare const BrowserSafeApis: {
1678
1678
  source: string;
1679
1679
  value: import("./options/color-space").ColorSpace;
1680
1680
  };
1681
- setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
1681
+ setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
1682
1682
  };
1683
1683
  readonly muted: {
1684
1684
  name: string;
@@ -1942,7 +1942,7 @@ export declare const BrowserSafeApis: {
1942
1942
  source: string;
1943
1943
  value: import("./options/color-space").ColorSpace;
1944
1944
  };
1945
- setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
1945
+ setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
1946
1946
  };
1947
1947
  readonly audioBitrate: {
1948
1948
  name: string;
package/dist/index.d.ts CHANGED
@@ -142,7 +142,7 @@ export declare const RenderInternals: {
142
142
  DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
143
143
  validateOpenGlRenderer: (option: unknown) => import("./options/gl").OpenGlRenderer | null;
144
144
  validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "h264-ts", "gif"];
145
- DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
145
+ DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuv422p" | "yuv444p" | "yuva420p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
146
146
  validateJpegQuality: (q: unknown) => void;
147
147
  DEFAULT_TIMEOUT: number;
148
148
  DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
@@ -353,7 +353,7 @@ export declare const RenderInternals: {
353
353
  validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
354
354
  validVideoImageFormats: readonly ["png", "jpeg", "none"];
355
355
  DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
356
- DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
356
+ DEFAULT_VIDEO_IMAGE_FORMAT: "none" | "png" | "jpeg";
357
357
  DEFAULT_JPEG_QUALITY: number;
358
358
  chalk: {
359
359
  enabled: () => boolean;
@@ -17,7 +17,7 @@ export declare const colorSpaceOption: {
17
17
  source: string;
18
18
  value: ColorSpace;
19
19
  };
20
- setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
20
+ setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
21
21
  };
22
22
  export declare const validateColorSpace: (option: unknown) => void;
23
23
  export {};
@@ -191,7 +191,7 @@ export declare const allOptions: {
191
191
  source: string;
192
192
  value: import("./color-space").ColorSpace;
193
193
  };
194
- setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
194
+ setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
195
195
  };
196
196
  deleteAfterOption: {
197
197
  name: string;
@@ -115,7 +115,7 @@ export declare const optionsMap: {
115
115
  source: string;
116
116
  value: import("./color-space").ColorSpace;
117
117
  };
118
- setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
118
+ setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
119
119
  };
120
120
  readonly codec: {
121
121
  name: string;
@@ -855,7 +855,7 @@ export declare const optionsMap: {
855
855
  source: string;
856
856
  value: import("./color-space").ColorSpace;
857
857
  };
858
- setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
858
+ setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
859
859
  };
860
860
  readonly muted: {
861
861
  name: string;
@@ -1119,7 +1119,7 @@ export declare const optionsMap: {
1119
1119
  source: string;
1120
1120
  value: import("./color-space").ColorSpace;
1121
1121
  };
1122
- setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
1122
+ setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
1123
1123
  };
1124
1124
  readonly audioBitrate: {
1125
1125
  name: string;
@@ -2887,6 +2887,7 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2887
2887
  }, 20000);
2888
2888
  };
2889
2889
  refreshTimeout();
2890
+ let finishEventSent = false;
2890
2891
  readFile(url).then((res) => {
2891
2892
  const contentDisposition = res.headers["content-disposition"] ?? null;
2892
2893
  const contentType = res.headers["content-type"] ?? null;
@@ -2900,11 +2901,13 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2900
2901
  if (rejected) {
2901
2902
  return;
2902
2903
  }
2903
- onProgress?.({
2904
- downloaded,
2905
- percent: 1,
2906
- totalSize: downloaded
2907
- });
2904
+ if (!finishEventSent) {
2905
+ onProgress?.({
2906
+ downloaded,
2907
+ percent: 1,
2908
+ totalSize: downloaded
2909
+ });
2910
+ }
2908
2911
  refreshTimeout();
2909
2912
  return resolveAndFlag({ sizeInBytes: downloaded, to });
2910
2913
  });
@@ -2915,11 +2918,15 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2915
2918
  refreshTimeout();
2916
2919
  downloaded += d.length;
2917
2920
  refreshTimeout();
2921
+ const percent = totalSize === null ? null : downloaded / totalSize;
2918
2922
  onProgress?.({
2919
2923
  downloaded,
2920
- percent: totalSize === null ? null : downloaded / totalSize,
2924
+ percent,
2921
2925
  totalSize
2922
2926
  });
2927
+ if (percent === 1) {
2928
+ finishEventSent = true;
2929
+ }
2923
2930
  });
2924
2931
  res.on("close", () => {
2925
2932
  if (totalSize !== null && downloaded !== totalSize) {
@@ -3164,7 +3171,7 @@ var defaultBrowserDownloadProgress = ({
3164
3171
  let lastProgress = 0;
3165
3172
  return {
3166
3173
  onProgress: (progress) => {
3167
- if (progress.downloadedBytes > lastProgress + 1e7) {
3174
+ if (progress.downloadedBytes > lastProgress + 1e7 || progress.percent === 1) {
3168
3175
  lastProgress = progress.downloadedBytes;
3169
3176
  Log.info({ indent, logLevel }, `Downloading Chrome Headless Shell - ${toMegabytes(progress.downloadedBytes)}/${toMegabytes(progress.totalSizeInBytes)}`);
3170
3177
  }
@@ -3188,7 +3195,8 @@ var getLocalBrowser = () => {
3188
3195
  };
3189
3196
 
3190
3197
  // src/ensure-browser.ts
3191
- var internalEnsureBrowser = async ({
3198
+ var currentEnsureBrowserOperation = Promise.resolve();
3199
+ var internalEnsureBrowserUncapped = async ({
3192
3200
  indent,
3193
3201
  logLevel,
3194
3202
  browserExecutable,
@@ -3202,6 +3210,10 @@ var internalEnsureBrowser = async ({
3202
3210
  const newStatus = getBrowserStatus(browserExecutable);
3203
3211
  return newStatus;
3204
3212
  };
3213
+ var internalEnsureBrowser = (options) => {
3214
+ currentEnsureBrowserOperation = currentEnsureBrowserOperation.then(() => internalEnsureBrowserUncapped(options));
3215
+ return currentEnsureBrowserOperation;
3216
+ };
3205
3217
  var getBrowserStatus = (browserExecutable) => {
3206
3218
  if (browserExecutable) {
3207
3219
  if (!fs5.existsSync(browserExecutable)) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
4
4
  },
5
5
  "name": "@remotion/renderer",
6
- "version": "4.0.221",
6
+ "version": "4.0.223",
7
7
  "description": "Render Remotion videos using Node.js or Bun",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "extract-zip": "2.0.1",
19
19
  "source-map": "^0.8.0-beta.0",
20
20
  "ws": "8.17.1",
21
- "remotion": "4.0.221",
22
- "@remotion/streaming": "4.0.221"
21
+ "remotion": "4.0.223",
22
+ "@remotion/streaming": "4.0.223"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": ">=16.8.0",
@@ -34,13 +34,13 @@
34
34
  "@types/ws": "8.5.10"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@remotion/compositor-linux-arm64-gnu": "4.0.221",
38
- "@remotion/compositor-linux-arm64-musl": "4.0.221",
39
- "@remotion/compositor-darwin-arm64": "4.0.221",
40
- "@remotion/compositor-darwin-x64": "4.0.221",
41
- "@remotion/compositor-linux-x64-gnu": "4.0.221",
42
- "@remotion/compositor-linux-x64-musl": "4.0.221",
43
- "@remotion/compositor-win32-x64-msvc": "4.0.221"
37
+ "@remotion/compositor-darwin-x64": "4.0.223",
38
+ "@remotion/compositor-linux-arm64-musl": "4.0.223",
39
+ "@remotion/compositor-linux-x64-gnu": "4.0.223",
40
+ "@remotion/compositor-darwin-arm64": "4.0.223",
41
+ "@remotion/compositor-linux-x64-musl": "4.0.223",
42
+ "@remotion/compositor-win32-x64-msvc": "4.0.223",
43
+ "@remotion/compositor-linux-arm64-gnu": "4.0.223"
44
44
  },
45
45
  "keywords": [
46
46
  "remotion",