@remotion/renderer 4.0.134 → 4.0.135
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/stitch-frames-to-video.d.ts +1 -0
- package/dist/stringify-ffmpeg-filter.d.ts +5 -0
- package/dist/stringify-ffmpeg-filter.js +9 -5
- package/package.json +9 -9
- package/dist/audio-codec.d.ts +0 -28
- package/dist/audio-codec.js +0 -88
- package/dist/check-apple-silicon.d.ts +0 -1
- package/dist/check-apple-silicon.js +0 -12
- package/dist/create-combined-video.d.ts +0 -18
- package/dist/create-combined-video.js +0 -27
- package/dist/does-have-m2-bug.d.ts +0 -3
- package/dist/does-have-m2-bug.js +0 -12
- package/dist/get-extension-from-audio-codec.d.ts +0 -2
- package/dist/get-extension-from-audio-codec.js +0 -19
- package/dist/is-audio-codec.d.ts +0 -2
- package/dist/is-audio-codec.js +0 -7
- package/dist/options/prores-profile.d.ts +0 -0
- package/dist/options/prores-profile.js +0 -1
- package/dist/x264-preset.d.ts +0 -22
- package/dist/x264-preset.js +0 -54
|
@@ -6,6 +6,11 @@ export type ProcessedTrack = {
|
|
|
6
6
|
pad_start: string | null;
|
|
7
7
|
pad_end: string | null;
|
|
8
8
|
};
|
|
9
|
+
export declare const getActualTrimLeft: ({ asset, fps, trimLeftOffset, }: {
|
|
10
|
+
asset: MediaAsset;
|
|
11
|
+
fps: number;
|
|
12
|
+
trimLeftOffset: number;
|
|
13
|
+
}) => number;
|
|
9
14
|
export declare const stringifyFfmpegFilter: ({ channels, volume, fps, assetDuration, chunkLengthInSeconds, forSeamlessAacConcatenation, trimLeftOffset, trimRightOffset, asset, }: {
|
|
10
15
|
channels: number;
|
|
11
16
|
volume: AssetVolume;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stringifyFfmpegFilter = void 0;
|
|
3
|
+
exports.stringifyFfmpegFilter = exports.getActualTrimLeft = void 0;
|
|
4
4
|
const calculate_atempo_1 = require("./assets/calculate-atempo");
|
|
5
5
|
const ffmpeg_volume_expression_1 = require("./assets/ffmpeg-volume-expression");
|
|
6
6
|
const sample_rate_1 = require("./sample-rate");
|
|
@@ -14,13 +14,15 @@ const stringifyTrim = (trim) => {
|
|
|
14
14
|
}
|
|
15
15
|
return asString;
|
|
16
16
|
};
|
|
17
|
+
const getActualTrimLeft = ({ asset, fps, trimLeftOffset, }) => asset.trimLeft / fps + trimLeftOffset;
|
|
18
|
+
exports.getActualTrimLeft = getActualTrimLeft;
|
|
17
19
|
const trimAndSetTempo = ({ forSeamlessAacConcatenation, assetDuration, asset, trimLeftOffset, trimRightOffset, fps, }) => {
|
|
18
20
|
// If we need seamless AAC stitching, we need to apply the tempo filter first
|
|
19
21
|
// because the atempo filter is not frame-perfect. It creates a small offset
|
|
20
22
|
// and the offset needs to be the same for all audio tracks, before processing it further.
|
|
21
23
|
// This also affects the trimLeft and trimRight values, as they need to be adjusted.
|
|
22
24
|
if (forSeamlessAacConcatenation) {
|
|
23
|
-
const trimLeft =
|
|
25
|
+
const trimLeft = (0, exports.getActualTrimLeft)({ asset, fps, trimLeftOffset });
|
|
24
26
|
const trimRight = trimLeft + (asset.duration / fps + trimRightOffset);
|
|
25
27
|
const trimRightOrAssetDuration = assetDuration
|
|
26
28
|
? Math.min(trimRight, assetDuration / asset.playbackRate)
|
|
@@ -46,7 +48,7 @@ const trimAndSetTempo = ({ forSeamlessAacConcatenation, assetDuration, asset, tr
|
|
|
46
48
|
// Otherwise, we first trim and then apply playback rate, as then the atempo
|
|
47
49
|
// filter needs to do less work.
|
|
48
50
|
if (!forSeamlessAacConcatenation) {
|
|
49
|
-
const trimLeft =
|
|
51
|
+
const trimLeft = (0, exports.getActualTrimLeft)({ asset, fps, trimLeftOffset });
|
|
50
52
|
const trimRight = (trimLeft + asset.duration / fps) * asset.playbackRate;
|
|
51
53
|
const trimRightOrAssetDuration = assetDuration
|
|
52
54
|
? Math.min(trimRight, assetDuration)
|
|
@@ -67,9 +69,11 @@ const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLeng
|
|
|
67
69
|
if (channels === 0) {
|
|
68
70
|
return null;
|
|
69
71
|
}
|
|
70
|
-
const { toneFrequency, startInVideo,
|
|
72
|
+
const { toneFrequency, startInVideo, playbackRate } = asset;
|
|
71
73
|
const startInVideoSeconds = startInVideo / fps;
|
|
72
|
-
if (assetDuration &&
|
|
74
|
+
if (assetDuration &&
|
|
75
|
+
(0, exports.getActualTrimLeft)({ asset, fps, trimLeftOffset }) >=
|
|
76
|
+
assetDuration / playbackRate) {
|
|
73
77
|
return null;
|
|
74
78
|
}
|
|
75
79
|
if (toneFrequency !== null && (toneFrequency <= 0 || toneFrequency > 2)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.135",
|
|
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.0.
|
|
21
|
+
"remotion": "4.0.135"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": ">=16.8.0",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"vitest": "0.31.1"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"@remotion/compositor-darwin-arm64": "4.0.
|
|
44
|
-
"@remotion/compositor-
|
|
45
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
46
|
-
"@remotion/compositor-linux-
|
|
47
|
-
"@remotion/compositor-linux-x64-
|
|
48
|
-
"@remotion/compositor-
|
|
49
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.
|
|
43
|
+
"@remotion/compositor-darwin-arm64": "4.0.135",
|
|
44
|
+
"@remotion/compositor-darwin-x64": "4.0.135",
|
|
45
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.135",
|
|
46
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.135",
|
|
47
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.135",
|
|
48
|
+
"@remotion/compositor-linux-x64-musl": "4.0.135",
|
|
49
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.135"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"remotion",
|
package/dist/audio-codec.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { Codec } from './codec';
|
|
2
|
-
export declare const validAudioCodecs: readonly ["pcm-16", "aac", "mp3", "opus"];
|
|
3
|
-
export type AudioCodec = (typeof validAudioCodecs)[number];
|
|
4
|
-
export declare const supportedAudioCodecs: {
|
|
5
|
-
readonly h264: readonly ["aac", "pcm-16", "mp3"];
|
|
6
|
-
readonly 'h264-mkv': readonly ["pcm-16", "mp3"];
|
|
7
|
-
readonly aac: readonly ["aac", "pcm-16"];
|
|
8
|
-
readonly gif: readonly [];
|
|
9
|
-
readonly h265: readonly ["aac", "pcm-16"];
|
|
10
|
-
readonly mp3: readonly ["mp3", "pcm-16"];
|
|
11
|
-
readonly prores: readonly ["aac", "pcm-16"];
|
|
12
|
-
readonly vp8: readonly ["opus", "pcm-16"];
|
|
13
|
-
readonly vp9: readonly ["opus", "pcm-16"];
|
|
14
|
-
readonly wav: readonly ["pcm-16"];
|
|
15
|
-
};
|
|
16
|
-
declare const audioCodecNames: readonly ["pcm_s16le", "libfdk_aac", "libmp3lame", "libopus"];
|
|
17
|
-
type FfmpegAudioCodecName = (typeof audioCodecNames)[number];
|
|
18
|
-
export declare const mapAudioCodecToFfmpegAudioCodecName: (audioCodec: AudioCodec) => FfmpegAudioCodecName;
|
|
19
|
-
export declare const defaultAudioCodecs: {
|
|
20
|
-
[key in Codec]: {
|
|
21
|
-
[k in 'compressed' | 'lossless']: (typeof supportedAudioCodecs)[key][number] | null;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export declare const getDefaultAudioCodec: ({ codec, preferLossless, }: {
|
|
25
|
-
codec: Codec;
|
|
26
|
-
preferLossless: boolean;
|
|
27
|
-
}) => AudioCodec | null;
|
|
28
|
-
export {};
|
package/dist/audio-codec.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDefaultAudioCodec = exports.defaultAudioCodecs = exports.mapAudioCodecToFfmpegAudioCodecName = exports.supportedAudioCodecs = exports.validAudioCodecs = void 0;
|
|
4
|
-
exports.validAudioCodecs = ['pcm-16', 'aac', 'mp3', 'opus'];
|
|
5
|
-
exports.supportedAudioCodecs = {
|
|
6
|
-
h264: ['aac', 'pcm-16', 'mp3'],
|
|
7
|
-
'h264-mkv': ['pcm-16', 'mp3'],
|
|
8
|
-
aac: ['aac', 'pcm-16'],
|
|
9
|
-
gif: [],
|
|
10
|
-
h265: ['aac', 'pcm-16'],
|
|
11
|
-
mp3: ['mp3', 'pcm-16'],
|
|
12
|
-
prores: ['aac', 'pcm-16'],
|
|
13
|
-
vp8: ['opus', 'pcm-16'],
|
|
14
|
-
vp9: ['opus', 'pcm-16'],
|
|
15
|
-
wav: ['pcm-16'],
|
|
16
|
-
};
|
|
17
|
-
const _satisfies = exports.supportedAudioCodecs;
|
|
18
|
-
if (_satisfies) {
|
|
19
|
-
// Just for type checking
|
|
20
|
-
}
|
|
21
|
-
const audioCodecNames = [
|
|
22
|
-
'pcm_s16le',
|
|
23
|
-
'libfdk_aac',
|
|
24
|
-
'libmp3lame',
|
|
25
|
-
'libopus',
|
|
26
|
-
];
|
|
27
|
-
const mapAudioCodecToFfmpegAudioCodecName = (audioCodec) => {
|
|
28
|
-
if (audioCodec === 'aac') {
|
|
29
|
-
return 'libfdk_aac';
|
|
30
|
-
}
|
|
31
|
-
if (audioCodec === 'mp3') {
|
|
32
|
-
return 'libmp3lame';
|
|
33
|
-
}
|
|
34
|
-
if (audioCodec === 'opus') {
|
|
35
|
-
return 'libopus';
|
|
36
|
-
}
|
|
37
|
-
if (audioCodec === 'pcm-16') {
|
|
38
|
-
return 'pcm_s16le';
|
|
39
|
-
}
|
|
40
|
-
throw new Error('unknown audio codec: ' + audioCodec);
|
|
41
|
-
};
|
|
42
|
-
exports.mapAudioCodecToFfmpegAudioCodecName = mapAudioCodecToFfmpegAudioCodecName;
|
|
43
|
-
exports.defaultAudioCodecs = {
|
|
44
|
-
'h264-mkv': {
|
|
45
|
-
lossless: 'pcm-16',
|
|
46
|
-
compressed: 'pcm-16',
|
|
47
|
-
},
|
|
48
|
-
aac: {
|
|
49
|
-
lossless: 'pcm-16',
|
|
50
|
-
compressed: 'aac',
|
|
51
|
-
},
|
|
52
|
-
gif: {
|
|
53
|
-
lossless: null,
|
|
54
|
-
compressed: null,
|
|
55
|
-
},
|
|
56
|
-
h264: {
|
|
57
|
-
lossless: 'pcm-16',
|
|
58
|
-
compressed: 'aac',
|
|
59
|
-
},
|
|
60
|
-
h265: {
|
|
61
|
-
lossless: 'pcm-16',
|
|
62
|
-
compressed: 'aac',
|
|
63
|
-
},
|
|
64
|
-
mp3: {
|
|
65
|
-
lossless: 'pcm-16',
|
|
66
|
-
compressed: 'mp3',
|
|
67
|
-
},
|
|
68
|
-
prores: {
|
|
69
|
-
lossless: 'pcm-16',
|
|
70
|
-
compressed: 'pcm-16',
|
|
71
|
-
},
|
|
72
|
-
vp8: {
|
|
73
|
-
lossless: 'pcm-16',
|
|
74
|
-
compressed: 'opus',
|
|
75
|
-
},
|
|
76
|
-
vp9: {
|
|
77
|
-
lossless: 'pcm-16',
|
|
78
|
-
compressed: 'opus',
|
|
79
|
-
},
|
|
80
|
-
wav: {
|
|
81
|
-
lossless: 'pcm-16',
|
|
82
|
-
compressed: 'pcm-16',
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
const getDefaultAudioCodec = ({ codec, preferLossless, }) => {
|
|
86
|
-
return exports.defaultAudioCodecs[codec][preferLossless ? 'lossless' : 'compressed'];
|
|
87
|
-
};
|
|
88
|
-
exports.getDefaultAudioCodec = getDefaultAudioCodec;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const checkNodeVersionAndWarnAboutRosetta: () => void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkNodeVersionAndWarnAboutRosetta = void 0;
|
|
4
|
-
const checkNodeVersionAndWarnAboutRosetta = () => {
|
|
5
|
-
const version = process.version.replace('v', '').split('.');
|
|
6
|
-
const majorVersion = Number(version[0]);
|
|
7
|
-
const requiredNodeVersion = 16;
|
|
8
|
-
if (majorVersion < 16) {
|
|
9
|
-
throw new Error(`Remotion requires at least Node ${requiredNodeVersion}. You currently have ${process.version}. Update your node version to ${requiredNodeVersion} to use Remotion.`);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
exports.checkNodeVersionAndWarnAboutRosetta = checkNodeVersionAndWarnAboutRosetta;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Codec } from './codec';
|
|
2
|
-
import type { LogLevel } from './log-level';
|
|
3
|
-
import type { CancelSignal } from './make-cancel-signal';
|
|
4
|
-
export declare const createCombinedVideo: ({ addRemotionMetadata, binariesDirectory, cancelSignal, codec, filelistDir, files, fps, indent, logLevel, numberOfGifLoops, onProgress, output, seamless, }: {
|
|
5
|
-
fps: number;
|
|
6
|
-
codec: Codec;
|
|
7
|
-
filelistDir: string;
|
|
8
|
-
numberOfGifLoops: number | null;
|
|
9
|
-
output: string;
|
|
10
|
-
indent: boolean;
|
|
11
|
-
logLevel: LogLevel;
|
|
12
|
-
onProgress: (p: number) => void;
|
|
13
|
-
files: string[];
|
|
14
|
-
addRemotionMetadata: boolean;
|
|
15
|
-
binariesDirectory: string | null;
|
|
16
|
-
cancelSignal: CancelSignal | undefined;
|
|
17
|
-
seamless: boolean;
|
|
18
|
-
}) => Promise<string | undefined>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCombinedVideo = void 0;
|
|
4
|
-
const combine_video_streams_1 = require("./combine-video-streams");
|
|
5
|
-
const combine_video_streams_seamlessly_1 = require("./combine-video-streams-seamlessly");
|
|
6
|
-
const createCombinedVideo = async ({ addRemotionMetadata, binariesDirectory, cancelSignal, codec, filelistDir, files, fps, indent, logLevel, numberOfGifLoops, onProgress, output, seamless, }) => {
|
|
7
|
-
if (seamless) {
|
|
8
|
-
return (0, combine_video_streams_seamlessly_1.combineVideoStreamsSeamlessly)({
|
|
9
|
-
files,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
await (0, combine_video_streams_1.combineVideoStreams)({
|
|
13
|
-
addRemotionMetadata,
|
|
14
|
-
binariesDirectory,
|
|
15
|
-
cancelSignal,
|
|
16
|
-
codec,
|
|
17
|
-
filelistDir,
|
|
18
|
-
files,
|
|
19
|
-
fps,
|
|
20
|
-
indent,
|
|
21
|
-
logLevel,
|
|
22
|
-
numberOfGifLoops,
|
|
23
|
-
onProgress,
|
|
24
|
-
output,
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
exports.createCombinedVideo = createCombinedVideo;
|
package/dist/does-have-m2-bug.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.warnAboutM2Bug = void 0;
|
|
4
|
-
const node_os_1 = require("node:os");
|
|
5
|
-
const warnAboutM2Bug = (codec, pixelFormat) => {
|
|
6
|
-
const isM2 = (0, node_os_1.cpus)().find((c) => c.model.includes('Apple M2'));
|
|
7
|
-
if (codec === 'prores' && pixelFormat === 'yuv422p10le' && isM2) {
|
|
8
|
-
console.warn();
|
|
9
|
-
console.warn('⚠️ Known issue: Apple M2 CPUs currently suffer from a bug where transparent ProRes videos have flickering. https://github.com/remotion-dev/remotion/issues/1929');
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
exports.warnAboutM2Bug = warnAboutM2Bug;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExtensionFromAudioCodec = void 0;
|
|
4
|
-
const getExtensionFromAudioCodec = (audioCodec) => {
|
|
5
|
-
if (audioCodec === 'aac') {
|
|
6
|
-
return 'aac';
|
|
7
|
-
}
|
|
8
|
-
if (audioCodec === 'opus') {
|
|
9
|
-
return 'opus';
|
|
10
|
-
}
|
|
11
|
-
if (audioCodec === 'mp3') {
|
|
12
|
-
return 'mp3';
|
|
13
|
-
}
|
|
14
|
-
if (audioCodec === 'pcm-16') {
|
|
15
|
-
return 'wav';
|
|
16
|
-
}
|
|
17
|
-
throw new Error(`Unsupported audio codec: ${audioCodec}`);
|
|
18
|
-
};
|
|
19
|
-
exports.getExtensionFromAudioCodec = getExtensionFromAudioCodec;
|
package/dist/is-audio-codec.d.ts
DELETED
package/dist/is-audio-codec.js
DELETED
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/x264-preset.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Codec } from './codec';
|
|
2
|
-
export declare const x264PresetOptions: readonly ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"];
|
|
3
|
-
export type X264Preset = (typeof x264PresetOptions)[number];
|
|
4
|
-
export declare const validateSelectedCodecAndPresetCombination: ({ codec, x264Preset, }: {
|
|
5
|
-
codec: Codec;
|
|
6
|
-
x264Preset: X264Preset | undefined;
|
|
7
|
-
}) => void;
|
|
8
|
-
export declare const x264Option: {
|
|
9
|
-
name: string;
|
|
10
|
-
cliFlag: "x264-preset";
|
|
11
|
-
description: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
ssrName: "x264Preset";
|
|
13
|
-
docLink: string;
|
|
14
|
-
type: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
|
15
|
-
getValue: ({ commandLine }: {
|
|
16
|
-
commandLine: Record<string, unknown>;
|
|
17
|
-
}) => {
|
|
18
|
-
value: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo";
|
|
19
|
-
source: string;
|
|
20
|
-
};
|
|
21
|
-
setConfig: (profile: X264Preset | undefined) => void;
|
|
22
|
-
};
|
package/dist/x264-preset.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.x264Option = exports.validateSelectedCodecAndPresetCombination = exports.x264PresetOptions = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
exports.x264PresetOptions = [
|
|
6
|
-
'ultrafast',
|
|
7
|
-
'superfast',
|
|
8
|
-
'veryfast',
|
|
9
|
-
'faster',
|
|
10
|
-
'fast',
|
|
11
|
-
'medium',
|
|
12
|
-
'slow',
|
|
13
|
-
'slower',
|
|
14
|
-
'veryslow',
|
|
15
|
-
'placebo',
|
|
16
|
-
];
|
|
17
|
-
let preset;
|
|
18
|
-
const validateSelectedCodecAndPresetCombination = ({ codec, x264Preset, }) => {
|
|
19
|
-
if (typeof x264Preset !== 'undefined' &&
|
|
20
|
-
codec !== 'h264' &&
|
|
21
|
-
codec !== 'h264-mkv') {
|
|
22
|
-
throw new TypeError(`You have set a x264 preset but the codec is "${codec}". Set the codec to "h264" or remove the Preset profile.`);
|
|
23
|
-
}
|
|
24
|
-
if (x264Preset !== undefined &&
|
|
25
|
-
!exports.x264PresetOptions.includes(x264Preset)) {
|
|
26
|
-
throw new TypeError(`The Preset profile "${x264Preset}" is not valid. Valid options are ${exports.x264PresetOptions
|
|
27
|
-
.map((p) => `"${p}"`)
|
|
28
|
-
.join(', ')}`);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
exports.validateSelectedCodecAndPresetCombination = validateSelectedCodecAndPresetCombination;
|
|
32
|
-
const cliFlag = 'x264-preset';
|
|
33
|
-
const DEFAULT_PRESET = 'medium';
|
|
34
|
-
exports.x264Option = {
|
|
35
|
-
name: 'x264 Preset',
|
|
36
|
-
cliFlag,
|
|
37
|
-
description: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Sets a x264 preset profile. Only applies to videos rendered with", ' ', (0, jsx_runtime_1.jsx)("code", { children: "h264" }), " codec.", (0, jsx_runtime_1.jsx)("br", {}), "Possible values: ", (0, jsx_runtime_1.jsx)("code", { children: "superfast" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "veryfast" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "faster" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "fast" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "medium" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "slow" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "slower" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "veryslow" }), ",", ' ', (0, jsx_runtime_1.jsx)("code", { children: "placebo" }), ".", (0, jsx_runtime_1.jsx)("br", {}), "Default: ", (0, jsx_runtime_1.jsx)("code", { children: DEFAULT_PRESET })] })),
|
|
38
|
-
ssrName: 'x264Preset',
|
|
39
|
-
docLink: 'https://www.remotion.dev/docs/renderer/render-media',
|
|
40
|
-
type: 'fast',
|
|
41
|
-
getValue: ({ commandLine }) => {
|
|
42
|
-
const value = commandLine[cliFlag];
|
|
43
|
-
if (typeof value !== 'undefined') {
|
|
44
|
-
return { value: value, source: 'cli' };
|
|
45
|
-
}
|
|
46
|
-
if (typeof preset !== 'undefined') {
|
|
47
|
-
return { value: preset, source: 'config' };
|
|
48
|
-
}
|
|
49
|
-
return { value: DEFAULT_PRESET, source: 'default' };
|
|
50
|
-
},
|
|
51
|
-
setConfig: (profile) => {
|
|
52
|
-
preset = profile;
|
|
53
|
-
},
|
|
54
|
-
};
|