@remotion/renderer 4.0.235 → 4.0.236
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.
- package/dist/ffmpeg-args.js +9 -2
- package/dist/get-codec-name.d.ts +16 -1
- package/dist/get-codec-name.js +47 -3
- package/package.json +16 -16
package/dist/ffmpeg-args.js
CHANGED
|
@@ -28,8 +28,15 @@ const firstEncodingStepOnly = ({ hasPreencoded, proResProfileName, pixelFormat,
|
|
|
28
28
|
].filter(truthy_1.truthy);
|
|
29
29
|
};
|
|
30
30
|
const generateFfmpegArgs = ({ hasPreencoded, proResProfileName, pixelFormat, x264Preset, codec, crf, videoBitrate, encodingMaxRate, encodingBufferSize, colorSpace, hardwareAcceleration, indent, logLevel, }) => {
|
|
31
|
-
const encoderSettings = (0, get_codec_name_1.getCodecName)(
|
|
32
|
-
|
|
31
|
+
const encoderSettings = (0, get_codec_name_1.getCodecName)({
|
|
32
|
+
codec,
|
|
33
|
+
encodingMaxRate,
|
|
34
|
+
encodingBufferSize,
|
|
35
|
+
crf,
|
|
36
|
+
hardwareAcceleration,
|
|
37
|
+
indent,
|
|
38
|
+
logLevel,
|
|
39
|
+
});
|
|
33
40
|
if (encoderSettings === null) {
|
|
34
41
|
throw new TypeError(`encoderSettings is null: ${JSON.stringify(codec)} (hwaccel = ${hardwareAcceleration})`);
|
|
35
42
|
}
|
package/dist/get-codec-name.d.ts
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import type { Codec } from './codec';
|
|
2
|
+
import type { LogLevel } from './log-level';
|
|
3
|
+
import type { HardwareAccelerationOption } from './options/hardware-acceleration';
|
|
2
4
|
export type CodecSettings = {
|
|
3
5
|
encoderName: string;
|
|
4
6
|
hardwareAccelerated: boolean;
|
|
5
7
|
};
|
|
6
|
-
export declare const
|
|
8
|
+
export declare const hasSpecifiedUnsupportedHardwareQualifySettings: ({ encodingMaxRate, encodingBufferSize, crf, }: {
|
|
9
|
+
encodingMaxRate: string | null;
|
|
10
|
+
encodingBufferSize: string | null;
|
|
11
|
+
crf: unknown;
|
|
12
|
+
}) => "crf" | "encodingBufferSize" | "encodingMaxRate" | null;
|
|
13
|
+
export declare const getCodecName: ({ codec, encodingMaxRate, encodingBufferSize, crf, hardwareAcceleration, logLevel, indent, }: {
|
|
14
|
+
codec: Codec;
|
|
15
|
+
hardwareAcceleration: HardwareAccelerationOption;
|
|
16
|
+
encodingMaxRate: string | null;
|
|
17
|
+
encodingBufferSize: string | null;
|
|
18
|
+
crf: unknown;
|
|
19
|
+
logLevel: LogLevel;
|
|
20
|
+
indent: boolean;
|
|
21
|
+
}) => CodecSettings | null;
|
package/dist/get-codec-name.js
CHANGED
|
@@ -1,17 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCodecName = void 0;
|
|
4
|
-
const
|
|
3
|
+
exports.getCodecName = exports.hasSpecifiedUnsupportedHardwareQualifySettings = void 0;
|
|
4
|
+
const logger_1 = require("./logger");
|
|
5
|
+
const hasSpecifiedUnsupportedHardwareQualifySettings = ({ encodingMaxRate, encodingBufferSize, crf, }) => {
|
|
6
|
+
if (encodingBufferSize !== null) {
|
|
7
|
+
return 'encodingBufferSize';
|
|
8
|
+
}
|
|
9
|
+
if (encodingMaxRate !== null) {
|
|
10
|
+
return 'encodingMaxRate';
|
|
11
|
+
}
|
|
12
|
+
if (crf !== null && typeof crf !== 'undefined') {
|
|
13
|
+
return 'crf';
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
exports.hasSpecifiedUnsupportedHardwareQualifySettings = hasSpecifiedUnsupportedHardwareQualifySettings;
|
|
18
|
+
const getCodecName = ({ codec, encodingMaxRate, encodingBufferSize, crf, hardwareAcceleration, logLevel, indent, }) => {
|
|
19
|
+
const preferredHwAcceleration = hardwareAcceleration === 'required' ||
|
|
20
|
+
hardwareAcceleration === 'if-possible';
|
|
21
|
+
const unsupportedQualityOption = (0, exports.hasSpecifiedUnsupportedHardwareQualifySettings)({
|
|
22
|
+
encodingMaxRate,
|
|
23
|
+
encodingBufferSize,
|
|
24
|
+
crf,
|
|
25
|
+
});
|
|
26
|
+
if (hardwareAcceleration === 'required' && unsupportedQualityOption) {
|
|
27
|
+
throw new Error(`When using hardware accelerated encoding, the option "${unsupportedQualityOption}" with hardware acceleration is not supported. Disable hardware accelerated encoding or use "if-possible" instead.`);
|
|
28
|
+
}
|
|
29
|
+
const warnAboutDisabledHardwareAcceleration = () => {
|
|
30
|
+
if (hardwareAcceleration === 'if-possible' && unsupportedQualityOption) {
|
|
31
|
+
logger_1.Log.warn({ indent, logLevel }, `${indent ? '' : '\n'}Hardware accelerated encoding disabled - "${unsupportedQualityOption}" option is not supported with hardware acceleration`);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
5
34
|
if (codec === 'prores') {
|
|
6
|
-
if (preferredHwAcceleration &&
|
|
35
|
+
if (preferredHwAcceleration &&
|
|
36
|
+
process.platform === 'darwin' &&
|
|
37
|
+
!unsupportedQualityOption) {
|
|
7
38
|
return { encoderName: 'prores_videotoolbox', hardwareAccelerated: true };
|
|
8
39
|
}
|
|
40
|
+
warnAboutDisabledHardwareAcceleration();
|
|
9
41
|
return { encoderName: 'prores_ks', hardwareAccelerated: false };
|
|
10
42
|
}
|
|
11
43
|
if (codec === 'h264') {
|
|
44
|
+
if (preferredHwAcceleration &&
|
|
45
|
+
process.platform === 'darwin' &&
|
|
46
|
+
!unsupportedQualityOption) {
|
|
47
|
+
return { encoderName: 'h264_videotoolbox', hardwareAccelerated: true };
|
|
48
|
+
}
|
|
49
|
+
warnAboutDisabledHardwareAcceleration();
|
|
12
50
|
return { encoderName: 'libx264', hardwareAccelerated: false };
|
|
13
51
|
}
|
|
14
52
|
if (codec === 'h265') {
|
|
53
|
+
if (preferredHwAcceleration &&
|
|
54
|
+
process.platform === 'darwin' &&
|
|
55
|
+
!unsupportedQualityOption) {
|
|
56
|
+
return { encoderName: 'hevc_videotoolbox', hardwareAccelerated: true };
|
|
57
|
+
}
|
|
58
|
+
warnAboutDisabledHardwareAcceleration();
|
|
15
59
|
return { encoderName: 'libx265', hardwareAccelerated: false };
|
|
16
60
|
}
|
|
17
61
|
if (codec === 'vp8') {
|
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.
|
|
6
|
+
"version": "4.0.236",
|
|
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,32 +18,32 @@
|
|
|
18
18
|
"extract-zip": "2.0.1",
|
|
19
19
|
"source-map": "^0.8.0-beta.0",
|
|
20
20
|
"ws": "8.17.1",
|
|
21
|
-
"@remotion/streaming": "4.0.
|
|
22
|
-
"remotion": "4.0.
|
|
21
|
+
"@remotion/streaming": "4.0.236",
|
|
22
|
+
"remotion": "4.0.236"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": ">=16.8.0",
|
|
26
26
|
"react-dom": ">=16.8.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@testing-library/dom": "
|
|
30
|
-
"@testing-library/react": "
|
|
29
|
+
"@testing-library/dom": "10.4.0",
|
|
30
|
+
"@testing-library/react": "16.1.0",
|
|
31
31
|
"@happy-dom/global-registrator": "14.5.1",
|
|
32
|
-
"react": "
|
|
33
|
-
"react-dom": "
|
|
32
|
+
"react": "19.0.0",
|
|
33
|
+
"react-dom": "19.0.0",
|
|
34
34
|
"@types/ws": "8.5.10",
|
|
35
35
|
"eslint": "9.14.0",
|
|
36
|
-
"@remotion/
|
|
37
|
-
"@remotion/
|
|
36
|
+
"@remotion/example-videos": "4.0.236",
|
|
37
|
+
"@remotion/eslint-config-internal": "4.0.236"
|
|
38
38
|
},
|
|
39
39
|
"optionalDependencies": {
|
|
40
|
-
"@remotion/compositor-darwin-arm64": "4.0.
|
|
41
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
42
|
-
"@remotion/compositor-linux-x64-
|
|
43
|
-
"@remotion/compositor-
|
|
44
|
-
"@remotion/compositor-
|
|
45
|
-
"@remotion/compositor-linux-arm64-musl": "4.0.
|
|
46
|
-
"@remotion/compositor-darwin-x64": "4.0.
|
|
40
|
+
"@remotion/compositor-darwin-arm64": "4.0.236",
|
|
41
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.236",
|
|
42
|
+
"@remotion/compositor-linux-x64-musl": "4.0.236",
|
|
43
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.236",
|
|
44
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.236",
|
|
45
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.236",
|
|
46
|
+
"@remotion/compositor-darwin-x64": "4.0.236"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"remotion",
|