@remotion/renderer 4.0.133 → 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/combine-videos.d.ts +2 -1
- package/dist/combine-videos.js +20 -15
- package/dist/index.d.ts +12 -1
- package/dist/index.js +5 -1
- package/dist/mux-video-and-audio.d.ts +2 -2
- package/dist/mux-video-and-audio.js +6 -6
- package/dist/render-has-audio.d.ts +8 -0
- package/dist/render-has-audio.js +20 -0
- package/dist/stitch-frames-to-video.d.ts +1 -0
- package/dist/stitch-frames-to-video.js +11 -3
- package/dist/stringify-ffmpeg-filter.d.ts +5 -0
- package/dist/stringify-ffmpeg-filter.js +22 -11
- 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
package/dist/combine-videos.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ type Options = {
|
|
|
20
20
|
cancelSignal: CancelSignal | undefined;
|
|
21
21
|
seamlessAudio: boolean;
|
|
22
22
|
seamlessVideo: boolean;
|
|
23
|
+
muted: boolean;
|
|
23
24
|
};
|
|
24
|
-
export declare const
|
|
25
|
+
export declare const combineChunks: ({ files, filelistDir, output, onProgress, numberOfFrames, codec, fps, numberOfGifLoops, resolvedAudioCodec, audioBitrate, indent, logLevel, chunkDurationInSeconds, binariesDirectory, cancelSignal, seamlessAudio, seamlessVideo, muted, }: Options) => Promise<void>;
|
|
25
26
|
export {};
|
package/dist/combine-videos.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Combine multiple video chunks, useful for decentralized rendering
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.combineChunks = void 0;
|
|
5
5
|
const node_fs_1 = require("node:fs");
|
|
6
6
|
const node_path_1 = require("node:path");
|
|
7
7
|
const combine_audio_1 = require("./combine-audio");
|
|
@@ -12,10 +12,12 @@ const logger_1 = require("./logger");
|
|
|
12
12
|
const mux_video_and_audio_1 = require("./mux-video-and-audio");
|
|
13
13
|
const audio_codec_1 = require("./options/audio-codec");
|
|
14
14
|
const truthy_1 = require("./truthy");
|
|
15
|
-
const
|
|
16
|
-
const shouldCreateAudio = resolvedAudioCodec !== null;
|
|
15
|
+
const combineChunks = async ({ files, filelistDir, output, onProgress, numberOfFrames, codec, fps, numberOfGifLoops, resolvedAudioCodec, audioBitrate, indent, logLevel, chunkDurationInSeconds, binariesDirectory, cancelSignal, seamlessAudio, seamlessVideo, muted, }) => {
|
|
16
|
+
const shouldCreateAudio = resolvedAudioCodec !== null && !muted;
|
|
17
17
|
const shouldCreateVideo = !(0, audio_codec_1.isAudioCodec)(codec);
|
|
18
|
-
const videoOutput =
|
|
18
|
+
const videoOutput = shouldCreateVideo
|
|
19
|
+
? (0, node_path_1.join)(filelistDir, `video.${(0, get_extension_from_codec_1.getFileExtensionFromCodec)(codec, resolvedAudioCodec)}`)
|
|
20
|
+
: null;
|
|
19
21
|
const audioOutput = shouldCreateAudio
|
|
20
22
|
? (0, node_path_1.join)(filelistDir, `audio.${(0, audio_codec_1.getExtensionFromAudioCodec)(resolvedAudioCodec)}`)
|
|
21
23
|
: null;
|
|
@@ -31,16 +33,24 @@ const combineVideos = async ({ files, filelistDir, output, onProgress, numberOfF
|
|
|
31
33
|
const actualProgress = concatenatedAudio + concatenatedVideo + muxing;
|
|
32
34
|
onProgress((actualProgress / totalFrames) * numberOfFrames);
|
|
33
35
|
};
|
|
34
|
-
logger_1.Log.verbose({ indent, logLevel }, `Combining chunks, audio = ${
|
|
36
|
+
logger_1.Log.verbose({ indent, logLevel }, `Combining chunks, audio = ${shouldCreateAudio === false
|
|
37
|
+
? 'no'
|
|
38
|
+
: seamlessAudio
|
|
39
|
+
? 'seamlessly'
|
|
40
|
+
: 'normally'}, video = ${shouldCreateVideo === false
|
|
41
|
+
? 'no'
|
|
42
|
+
: seamlessVideo
|
|
43
|
+
? 'seamlessly'
|
|
44
|
+
: 'normally'}`);
|
|
35
45
|
await Promise.all([
|
|
36
|
-
shouldCreateAudio
|
|
46
|
+
shouldCreateAudio && audioOutput
|
|
37
47
|
? (0, combine_audio_1.createCombinedAudio)({
|
|
38
48
|
audioBitrate,
|
|
39
49
|
filelistDir,
|
|
40
50
|
files: audioFiles,
|
|
41
51
|
indent,
|
|
42
52
|
logLevel,
|
|
43
|
-
output:
|
|
53
|
+
output: audioOutput,
|
|
44
54
|
resolvedAudioCodec,
|
|
45
55
|
seamless: seamlessAudio,
|
|
46
56
|
chunkDurationInSeconds,
|
|
@@ -54,7 +64,7 @@ const combineVideos = async ({ files, filelistDir, output, onProgress, numberOfF
|
|
|
54
64
|
},
|
|
55
65
|
})
|
|
56
66
|
: null,
|
|
57
|
-
shouldCreateVideo && !seamlessVideo
|
|
67
|
+
shouldCreateVideo && !seamlessVideo && videoOutput
|
|
58
68
|
? (0, combine_video_streams_1.combineVideoStreams)({
|
|
59
69
|
codec,
|
|
60
70
|
filelistDir,
|
|
@@ -62,7 +72,7 @@ const combineVideos = async ({ files, filelistDir, output, onProgress, numberOfF
|
|
|
62
72
|
indent,
|
|
63
73
|
logLevel,
|
|
64
74
|
numberOfGifLoops,
|
|
65
|
-
output:
|
|
75
|
+
output: videoOutput,
|
|
66
76
|
files: videoFiles,
|
|
67
77
|
addRemotionMetadata: !shouldCreateAudio,
|
|
68
78
|
binariesDirectory,
|
|
@@ -74,11 +84,6 @@ const combineVideos = async ({ files, filelistDir, output, onProgress, numberOfF
|
|
|
74
84
|
})
|
|
75
85
|
: null,
|
|
76
86
|
].filter(truthy_1.truthy));
|
|
77
|
-
// Either only audio or only video
|
|
78
|
-
if (!(audioOutput && shouldCreateVideo)) {
|
|
79
|
-
(0, node_fs_1.rmSync)(filelistDir, { recursive: true });
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
87
|
try {
|
|
83
88
|
await (0, mux_video_and_audio_1.muxVideoAndAudio)({
|
|
84
89
|
audioOutput,
|
|
@@ -104,4 +109,4 @@ const combineVideos = async ({ files, filelistDir, output, onProgress, numberOfF
|
|
|
104
109
|
throw err;
|
|
105
110
|
}
|
|
106
111
|
};
|
|
107
|
-
exports.
|
|
112
|
+
exports.combineChunks = combineChunks;
|
package/dist/index.d.ts
CHANGED
|
@@ -160,7 +160,7 @@ export declare const RenderInternals: {
|
|
|
160
160
|
}) => number;
|
|
161
161
|
findRemotionRoot: () => string;
|
|
162
162
|
validateBitrate: (bitrate: unknown, name: string) => void;
|
|
163
|
-
|
|
163
|
+
combineChunks: ({ files, filelistDir, output, onProgress, numberOfFrames, codec, fps, numberOfGifLoops, resolvedAudioCodec, audioBitrate, indent, logLevel, chunkDurationInSeconds, binariesDirectory, cancelSignal, seamlessAudio, seamlessVideo, muted, }: {
|
|
164
164
|
files: string[];
|
|
165
165
|
filelistDir: string;
|
|
166
166
|
output: string;
|
|
@@ -178,6 +178,7 @@ export declare const RenderInternals: {
|
|
|
178
178
|
cancelSignal: import("./make-cancel-signal").CancelSignal | undefined;
|
|
179
179
|
seamlessAudio: boolean;
|
|
180
180
|
seamlessVideo: boolean;
|
|
181
|
+
muted: boolean;
|
|
181
182
|
}) => Promise<void>;
|
|
182
183
|
getMinConcurrency: () => number;
|
|
183
184
|
getMaxConcurrency: () => number;
|
|
@@ -747,4 +748,14 @@ export declare const RenderInternals: {
|
|
|
747
748
|
preferLossless: boolean;
|
|
748
749
|
separateAudioTo: string | null;
|
|
749
750
|
}) => "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
751
|
+
getShouldRenderAudio: ({ codec, assetsInfo, enforceAudioTrack, muted, }: {
|
|
752
|
+
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif";
|
|
753
|
+
assetsInfo: import("./assets/download-map").RenderAssetInfo | null;
|
|
754
|
+
enforceAudioTrack: boolean;
|
|
755
|
+
muted: boolean;
|
|
756
|
+
}) => "yes" | "maybe" | "no";
|
|
757
|
+
codecSupportsMedia: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif") => {
|
|
758
|
+
video: boolean;
|
|
759
|
+
audio: boolean;
|
|
760
|
+
};
|
|
750
761
|
};
|
package/dist/index.js
CHANGED
|
@@ -109,8 +109,10 @@ Object.defineProperty(exports, "stitchFramesToVideo", { enumerable: true, get: f
|
|
|
109
109
|
var validate_output_filename_1 = require("./validate-output-filename");
|
|
110
110
|
Object.defineProperty(exports, "validateOutputFilename", { enumerable: true, get: function () { return validate_output_filename_1.validateOutputFilename; } });
|
|
111
111
|
const download_map_1 = require("./assets/download-map");
|
|
112
|
+
const codec_supports_media_1 = require("./codec-supports-media");
|
|
112
113
|
const make_file_executable_1 = require("./compositor/make-file-executable");
|
|
113
114
|
const audio_codec_1 = require("./options/audio-codec");
|
|
115
|
+
const render_has_audio_1 = require("./render-has-audio");
|
|
114
116
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
115
117
|
const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
116
118
|
const wait_for_symbolication_error_to_be_done_1 = require("./wait-for-symbolication-error-to-be-done");
|
|
@@ -160,7 +162,7 @@ exports.RenderInternals = {
|
|
|
160
162
|
convertToPositiveFrameIndex: convert_to_positive_frame_index_1.convertToPositiveFrameIndex,
|
|
161
163
|
findRemotionRoot: find_closest_package_json_1.findRemotionRoot,
|
|
162
164
|
validateBitrate: validate_videobitrate_1.validateBitrate,
|
|
163
|
-
|
|
165
|
+
combineChunks: combine_videos_1.combineChunks,
|
|
164
166
|
getMinConcurrency: validate_concurrency_1.getMinConcurrency,
|
|
165
167
|
getMaxConcurrency: validate_concurrency_1.getMaxConcurrency,
|
|
166
168
|
getDefaultAudioCodec: audio_codec_1.getDefaultAudioCodec,
|
|
@@ -197,6 +199,8 @@ exports.RenderInternals = {
|
|
|
197
199
|
getExtensionFromAudioCodec: audio_codec_1.getExtensionFromAudioCodec,
|
|
198
200
|
makeFileExecutableIfItIsNot: make_file_executable_1.makeFileExecutableIfItIsNot,
|
|
199
201
|
resolveAudioCodec: audio_codec_1.resolveAudioCodec,
|
|
202
|
+
getShouldRenderAudio: render_has_audio_1.getShouldRenderAudio,
|
|
203
|
+
codecSupportsMedia: codec_supports_media_1.codecSupportsMedia,
|
|
200
204
|
};
|
|
201
205
|
// Warn of potential performance issues with Apple Silicon (M1 chip under Rosetta)
|
|
202
206
|
(0, check_version_requirements_1.checkNodeVersionAndWarnAboutRosetta)('info', false);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { LogLevel } from './log-level';
|
|
2
2
|
import type { CancelSignal } from './make-cancel-signal';
|
|
3
3
|
export declare const muxVideoAndAudio: ({ videoOutput, audioOutput, output, indent, logLevel, onProgress, binariesDirectory, fps, cancelSignal, }: {
|
|
4
|
-
videoOutput: string;
|
|
5
|
-
audioOutput: string;
|
|
4
|
+
videoOutput: string | null;
|
|
5
|
+
audioOutput: string | null;
|
|
6
6
|
output: string;
|
|
7
7
|
indent: boolean;
|
|
8
8
|
logLevel: LogLevel;
|
|
@@ -12,14 +12,14 @@ const muxVideoAndAudio = async ({ videoOutput, audioOutput, output, indent, logL
|
|
|
12
12
|
logger_1.Log.verbose({ indent, logLevel }, 'Muxing video and audio together');
|
|
13
13
|
const command = [
|
|
14
14
|
'-hide_banner',
|
|
15
|
-
'-i',
|
|
15
|
+
videoOutput ? '-i' : null,
|
|
16
16
|
videoOutput,
|
|
17
|
-
'-i',
|
|
17
|
+
audioOutput ? '-i' : null,
|
|
18
18
|
audioOutput,
|
|
19
|
-
'-c:v',
|
|
20
|
-
'copy',
|
|
21
|
-
'-c:a',
|
|
22
|
-
'copy',
|
|
19
|
+
videoOutput ? '-c:v' : null,
|
|
20
|
+
videoOutput ? 'copy' : null,
|
|
21
|
+
audioOutput ? '-c:a' : null,
|
|
22
|
+
audioOutput ? 'copy' : null,
|
|
23
23
|
`-metadata`,
|
|
24
24
|
`comment=Made with Remotion ${version_1.VERSION}`,
|
|
25
25
|
'-y',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RenderAssetInfo } from './assets/download-map';
|
|
2
|
+
import type { Codec } from './codec';
|
|
3
|
+
export declare const getShouldRenderAudio: ({ codec, assetsInfo, enforceAudioTrack, muted, }: {
|
|
4
|
+
codec: Codec;
|
|
5
|
+
assetsInfo: RenderAssetInfo | null;
|
|
6
|
+
enforceAudioTrack: boolean;
|
|
7
|
+
muted: boolean;
|
|
8
|
+
}) => 'yes' | 'maybe' | 'no';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getShouldRenderAudio = void 0;
|
|
4
|
+
const codec_supports_media_1 = require("./codec-supports-media");
|
|
5
|
+
const getShouldRenderAudio = ({ codec, assetsInfo, enforceAudioTrack, muted, }) => {
|
|
6
|
+
if (muted) {
|
|
7
|
+
return 'no';
|
|
8
|
+
}
|
|
9
|
+
if (!(0, codec_supports_media_1.codecSupportsMedia)(codec).audio) {
|
|
10
|
+
return 'no';
|
|
11
|
+
}
|
|
12
|
+
if (enforceAudioTrack) {
|
|
13
|
+
return 'yes';
|
|
14
|
+
}
|
|
15
|
+
if (assetsInfo === null) {
|
|
16
|
+
return 'maybe';
|
|
17
|
+
}
|
|
18
|
+
return assetsInfo.assets.flat(1).length > 0 ? 'yes' : 'no';
|
|
19
|
+
};
|
|
20
|
+
exports.getShouldRenderAudio = getShouldRenderAudio;
|
|
@@ -25,6 +25,7 @@ const audio_codec_1 = require("./options/audio-codec");
|
|
|
25
25
|
const parse_ffmpeg_progress_1 = require("./parse-ffmpeg-progress");
|
|
26
26
|
const pixel_format_1 = require("./pixel-format");
|
|
27
27
|
const prores_profile_1 = require("./prores-profile");
|
|
28
|
+
const render_has_audio_1 = require("./render-has-audio");
|
|
28
29
|
const validate_1 = require("./validate");
|
|
29
30
|
const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
|
|
30
31
|
const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
@@ -52,9 +53,16 @@ const innerStitchFramesToVideo = async ({ assetsInfo, audioBitrate, audioCodec:
|
|
|
52
53
|
assetsInfo.downloadMap.preventCleanup();
|
|
53
54
|
const proResProfileName = (0, get_prores_profile_name_1.getProResProfileName)(codec, proResProfile);
|
|
54
55
|
const mediaSupport = (0, codec_supports_media_1.codecSupportsMedia)(codec);
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const renderAudioEvaluation = (0, render_has_audio_1.getShouldRenderAudio)({
|
|
57
|
+
assetsInfo,
|
|
58
|
+
codec,
|
|
59
|
+
enforceAudioTrack,
|
|
60
|
+
muted,
|
|
61
|
+
});
|
|
62
|
+
if (renderAudioEvaluation === 'maybe') {
|
|
63
|
+
throw new Error('Remotion is not sure whether to render audio. Please report this in the Remotion repo.');
|
|
64
|
+
}
|
|
65
|
+
const shouldRenderAudio = renderAudioEvaluation === 'yes';
|
|
58
66
|
const shouldRenderVideo = mediaSupport.video;
|
|
59
67
|
if (!shouldRenderAudio && !shouldRenderVideo) {
|
|
60
68
|
throw new Error('The output format has neither audio nor video. This can happen if you are rendering an audio codec and the output file has no audio or the muted flag was passed.');
|
|
@@ -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,32 +14,41 @@ 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 = (
|
|
24
|
-
const trimRight = trimLeft + (asset.duration / fps + trimRightOffset)
|
|
25
|
+
const trimLeft = (0, exports.getActualTrimLeft)({ asset, fps, trimLeftOffset });
|
|
26
|
+
const trimRight = trimLeft + (asset.duration / fps + trimRightOffset);
|
|
25
27
|
const trimRightOrAssetDuration = assetDuration
|
|
26
28
|
? Math.min(trimRight, assetDuration / asset.playbackRate)
|
|
27
29
|
: trimRight;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
if (trimRightOrAssetDuration < trimLeft) {
|
|
31
|
+
throw new Error('trimRightOrAssetDuration < trimLeft: ' +
|
|
32
|
+
JSON.stringify({
|
|
33
|
+
trimRight,
|
|
34
|
+
trimLeft,
|
|
35
|
+
assetDuration,
|
|
36
|
+
assetTrimLeft: asset.trimLeft,
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
30
39
|
return {
|
|
31
40
|
filter: [
|
|
32
41
|
(0, calculate_atempo_1.calculateATempo)(asset.playbackRate),
|
|
33
|
-
`atrim=${stringifyTrim(
|
|
42
|
+
`atrim=${stringifyTrim(trimLeft)}:${stringifyTrim(trimRight)}`,
|
|
34
43
|
],
|
|
35
|
-
actualTrimLeft,
|
|
36
|
-
audibleDuration:
|
|
44
|
+
actualTrimLeft: trimLeft,
|
|
45
|
+
audibleDuration: trimRight - trimLeft,
|
|
37
46
|
};
|
|
38
47
|
}
|
|
39
48
|
// Otherwise, we first trim and then apply playback rate, as then the atempo
|
|
40
49
|
// filter needs to do less work.
|
|
41
50
|
if (!forSeamlessAacConcatenation) {
|
|
42
|
-
const trimLeft =
|
|
51
|
+
const trimLeft = (0, exports.getActualTrimLeft)({ asset, fps, trimLeftOffset });
|
|
43
52
|
const trimRight = (trimLeft + asset.duration / fps) * asset.playbackRate;
|
|
44
53
|
const trimRightOrAssetDuration = assetDuration
|
|
45
54
|
? Math.min(trimRight, assetDuration)
|
|
@@ -60,9 +69,11 @@ const stringifyFfmpegFilter = ({ channels, volume, fps, assetDuration, chunkLeng
|
|
|
60
69
|
if (channels === 0) {
|
|
61
70
|
return null;
|
|
62
71
|
}
|
|
63
|
-
const { toneFrequency, startInVideo,
|
|
72
|
+
const { toneFrequency, startInVideo, playbackRate } = asset;
|
|
64
73
|
const startInVideoSeconds = startInVideo / fps;
|
|
65
|
-
if (assetDuration &&
|
|
74
|
+
if (assetDuration &&
|
|
75
|
+
(0, exports.getActualTrimLeft)({ asset, fps, trimLeftOffset }) >=
|
|
76
|
+
assetDuration / playbackRate) {
|
|
66
77
|
return null;
|
|
67
78
|
}
|
|
68
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-darwin-x64": "4.0.
|
|
45
|
-
"@remotion/compositor-linux-arm64-
|
|
46
|
-
"@remotion/compositor-linux-arm64-
|
|
47
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.
|
|
48
|
-
"@remotion/compositor-linux-x64-musl": "4.0.
|
|
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
|
-
};
|