@remotion/renderer 4.0.265 → 4.0.267

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.
@@ -3,6 +3,7 @@ export declare const nextFrameToRenderState: ({ allFramesAndExtraFrames, concurr
3
3
  concurrencyOrFramesToRender: number;
4
4
  }) => {
5
5
  getNextFrame: (_pageIndex: number) => number;
6
+ returnFrame: (frame: number) => void;
6
7
  };
7
8
  type Fn = typeof nextFrameToRenderState;
8
9
  export type NextFrameToRender = ReturnType<Fn>;
@@ -18,6 +18,9 @@ concurrencyOrFramesToRender: _concurrency, }) => {
18
18
  rendered.set(nextFrame, true);
19
19
  return nextFrame;
20
20
  },
21
+ returnFrame: (frame) => {
22
+ rendered.delete(frame);
23
+ },
21
24
  };
22
25
  };
23
26
  exports.nextFrameToRenderState = nextFrameToRenderState;
@@ -30,6 +33,9 @@ const partitionedNextFrameToRenderState = ({ allFramesAndExtraFrames, concurrenc
30
33
  getNextFrame: (pageIndex) => {
31
34
  return partitions.getNextFrame(pageIndex);
32
35
  },
36
+ returnFrame: () => {
37
+ throw new Error('retrying failed frames for partitioned rendering is not supported. Disable partitioned rendering.');
38
+ },
33
39
  };
34
40
  };
35
41
  exports.partitionedNextFrameToRenderState = partitionedNextFrameToRenderState;
@@ -17,4 +17,4 @@ export declare const offthreadVideoThreadsOption: {
17
17
  };
18
18
  setConfig: (size: number | null) => void;
19
19
  };
20
- export declare const DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS = 3;
20
+ export declare const DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS = 2;
@@ -37,4 +37,4 @@ exports.offthreadVideoThreadsOption = {
37
37
  value = size !== null && size !== void 0 ? size : null;
38
38
  },
39
39
  };
40
- exports.DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS = 3;
40
+ exports.DEFAULT_RENDER_FRAMES_OFFTHREAD_VIDEO_THREADS = 2;
@@ -81,6 +81,7 @@ const renderFrameAndRetryTargetClose = async ({ retriesLeft, attempt, assets, im
81
81
  pool.release(newPage);
82
82
  logger_1.Log.warn({ indent, logLevel }, `delayRender() timed out while rendering frame ${frame}: ${err.message}`);
83
83
  const actualRetriesLeft = (0, is_delay_render_error_with_retry_1.getRetriesLeftFromError)(err);
84
+ nextFrameToRender.returnFrame(frame);
84
85
  return (0, exports.renderFrameAndRetryTargetClose)({
85
86
  retriesLeft: actualRetriesLeft,
86
87
  attempt: attempt + 1,
@@ -127,6 +128,7 @@ const renderFrameAndRetryTargetClose = async ({ retriesLeft, attempt, assets, im
127
128
  pool.release(newPage);
128
129
  }
129
130
  });
131
+ nextFrameToRender.returnFrame(frame);
130
132
  await (0, exports.renderFrameAndRetryTargetClose)({
131
133
  retriesLeft: retriesLeft - 1,
132
134
  attempt: attempt + 1,
@@ -83,7 +83,7 @@ const waitForReady = ({ page, timeoutInMilliseconds, frame, indent, logLevel, })
83
83
  timeoutInMilliseconds: 5000,
84
84
  })
85
85
  .then((res) => {
86
- reject(new Error(`Timeout (${timeoutInMilliseconds}ms) exceeded rendering the component${frame ? ' at frame ' + frame : ' initially'}. ${res.value ? `Open delayRender() handles: ${res.value}` : ''}`));
86
+ reject(new Error(`Timeout (${timeoutInMilliseconds}ms) exceeded rendering the component${frame ? ' at frame ' + frame : ' initially'}. ${res.value ? `Open delayRender() handles: ${res.value}` : ''}. You can increase the timeout using the "timeoutInMilliseconds" / "--timeout" option of the function or command you used to trigger this render.`));
87
87
  })
88
88
  .catch((newErr) => {
89
89
  logger_1.Log.warn({ indent, logLevel }, 'Tried to get delayRender() handles for timeout, but could not do so because of', newErr);
@@ -38,12 +38,12 @@ const validateEvenDimensionsWithCodec = ({ width, height, codec, scale, wantsIma
38
38
  .join(' ');
39
39
  throw new Error(message);
40
40
  }
41
- if (height % 2 !== 0) {
41
+ if (actualHeight % 2 !== 0) {
42
42
  const message = [
43
43
  `Codec error: You are trying to render a video with a ${displayName} codec that has a height of ${actualHeight}px, which is an uneven number.`,
44
44
  `The ${displayName} codec does only support dimensions that are evenly divisible by two. `,
45
45
  scale === 1
46
- ? `Change the height to ${Math.floor(height - 1)}px to fix this issue.`
46
+ ? `Change the height to ${Math.floor(actualHeight - 1)}px to fix this issue.`
47
47
  : `You have used the "scale" option which might be the reason for the problem: The original height is ${height} and the scale is ${scale}x, which was multiplied to get the actual height.`,
48
48
  ].join(' ');
49
49
  throw new Error(message);
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.265",
6
+ "version": "4.0.267",
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.265",
22
- "@remotion/streaming": "4.0.265"
21
+ "remotion": "4.0.267",
22
+ "@remotion/streaming": "4.0.267"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": ">=16.8.0",
@@ -33,17 +33,17 @@
33
33
  "react-dom": "19.0.0",
34
34
  "@types/ws": "8.5.10",
35
35
  "eslint": "9.19.0",
36
- "@remotion/example-videos": "4.0.265",
37
- "@remotion/eslint-config-internal": "4.0.265"
36
+ "@remotion/example-videos": "4.0.267",
37
+ "@remotion/eslint-config-internal": "4.0.267"
38
38
  },
39
39
  "optionalDependencies": {
40
- "@remotion/compositor-darwin-x64": "4.0.265",
41
- "@remotion/compositor-darwin-arm64": "4.0.265",
42
- "@remotion/compositor-linux-arm64-gnu": "4.0.265",
43
- "@remotion/compositor-linux-arm64-musl": "4.0.265",
44
- "@remotion/compositor-linux-x64-musl": "4.0.265",
45
- "@remotion/compositor-win32-x64-msvc": "4.0.265",
46
- "@remotion/compositor-linux-x64-gnu": "4.0.265"
40
+ "@remotion/compositor-darwin-x64": "4.0.267",
41
+ "@remotion/compositor-linux-arm64-gnu": "4.0.267",
42
+ "@remotion/compositor-darwin-arm64": "4.0.267",
43
+ "@remotion/compositor-linux-arm64-musl": "4.0.267",
44
+ "@remotion/compositor-linux-x64-musl": "4.0.267",
45
+ "@remotion/compositor-linux-x64-gnu": "4.0.267",
46
+ "@remotion/compositor-win32-x64-msvc": "4.0.267"
47
47
  },
48
48
  "keywords": [
49
49
  "remotion",
@@ -1,4 +0,0 @@
1
- import type { LogLevel } from '../log-level';
2
- import type { CompositorCommand, CompositorCommandSerialized } from './payloads';
3
- export declare const serializeCommand: <Type extends keyof CompositorCommand>(command: Type, params: CompositorCommand[Type]) => CompositorCommandSerialized<Type>;
4
- export declare const callCompositor: (payload: string, indent: boolean, logLevel: LogLevel, binariesDirectory: string | null) => Promise<void>;
@@ -1,79 +0,0 @@
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.callCompositor = exports.serializeCommand = void 0;
7
- const node_child_process_1 = require("node:child_process");
8
- const node_path_1 = __importDefault(require("node:path"));
9
- const get_executable_path_1 = require("./get-executable-path");
10
- const make_file_executable_1 = require("./make-file-executable");
11
- const make_nonce_1 = require("./make-nonce");
12
- const serializeCommand = (command, params) => {
13
- return {
14
- nonce: (0, make_nonce_1.makeNonce)(),
15
- payload: {
16
- type: command,
17
- params,
18
- },
19
- };
20
- };
21
- exports.serializeCommand = serializeCommand;
22
- const callCompositor = (payload, indent, logLevel, binariesDirectory) => {
23
- return new Promise((resolve, reject) => {
24
- const execPath = (0, get_executable_path_1.getExecutablePath)({
25
- type: 'compositor',
26
- indent,
27
- logLevel,
28
- binariesDirectory,
29
- });
30
- (0, make_file_executable_1.makeFileExecutableIfItIsNot)(execPath);
31
- const child = (0, node_child_process_1.spawn)(execPath, [payload], {
32
- cwd: node_path_1.default.dirname(execPath),
33
- });
34
- const stderrChunks = [];
35
- child.stderr.on('data', (d) => stderrChunks.push(d));
36
- child.on('close', (code) => {
37
- if (code === 0) {
38
- resolve();
39
- }
40
- else {
41
- const message = Buffer.concat(stderrChunks).toString('utf-8');
42
- try {
43
- // Try to see if the error is a JSON
44
- const parsed = JSON.parse(message);
45
- const msg = `Compositor error: ${parsed.error}`;
46
- const err = new Error(`${msg}\n${parsed.backtrace}`);
47
- reject(err);
48
- }
49
- catch (_a) {
50
- reject(new Error(`Compositor panicked with code ${code}: ${message}`));
51
- }
52
- }
53
- });
54
- if (child.stdin.closed) {
55
- reject(new Error('Compositor stdin closed unexpectedly,' +
56
- Buffer.concat(stderrChunks).toString('utf-8')));
57
- return;
58
- }
59
- try {
60
- child.stdin.write(payload, (e) => {
61
- if (e) {
62
- if (e instanceof Error && e.message.includes('EPIPE')) {
63
- reject(new Error('Compositor stdin closed unexpectedly,' +
64
- Buffer.concat(stderrChunks).toString('utf-8')));
65
- }
66
- return;
67
- }
68
- child.stdin.end();
69
- });
70
- }
71
- catch (err) {
72
- if (err instanceof Error && err.message.includes('EPIPE')) {
73
- reject(new Error('Compositor stdin closed unexpectedly,' +
74
- Buffer.concat(stderrChunks).toString('utf-8')));
75
- }
76
- }
77
- });
78
- };
79
- exports.callCompositor = callCompositor;