@remotion/renderer 4.0.125 → 4.0.127
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/assets/convert-assets-to-file-urls.d.ts +2 -1
- package/dist/assets/convert-assets-to-file-urls.js +6 -4
- package/dist/assets/download-map.d.ts +6 -2
- package/dist/assets/ffmpeg-volume-expression.js +7 -3
- package/dist/calculate-ffmpeg-filters.d.ts +4 -2
- package/dist/calculate-ffmpeg-filters.js +10 -17
- package/dist/check-apple-silicon.d.ts +1 -3
- package/dist/check-apple-silicon.js +2 -32
- package/dist/client.d.ts +124 -88
- package/dist/combine-audio.js +6 -6
- package/dist/combine-videos.js +1 -0
- package/dist/compress-audio.d.ts +2 -2
- package/dist/compress-audio.js +4 -7
- package/dist/create-audio.d.ts +11 -4
- package/dist/create-audio.js +7 -5
- package/dist/create-combined-video.d.ts +3 -2
- package/dist/create-combined-video.js +7 -1
- package/dist/create-ffmpeg-complex-filter.d.ts +1 -4
- package/dist/create-silent-audio.d.ts +2 -2
- package/dist/create-silent-audio.js +2 -2
- package/dist/does-have-m2-bug.d.ts +3 -0
- package/dist/does-have-m2-bug.js +12 -0
- package/dist/get-extension-from-audio-codec.d.ts +2 -2
- package/dist/get-extension-from-codec.d.ts +2 -2
- package/dist/get-extra-frames-to-capture.d.ts +13 -0
- package/dist/get-extra-frames-to-capture.js +63 -0
- package/dist/index.d.ts +40 -40
- package/dist/logger.js +3 -1
- package/dist/merge-audio-track.d.ts +1 -1
- package/dist/merge-audio-track.js +7 -11
- package/dist/options/audio-codec.d.ts +5 -5
- package/dist/options/index.d.ts +44 -8
- package/dist/options/index.js +4 -0
- package/dist/options/options-map.d.ts +26 -26
- package/dist/options/options-map.js +1 -1
- package/dist/options/prores-profile.d.ts +0 -0
- package/dist/options/prores-profile.js +1 -0
- package/dist/options/{separate-audio-to.d.ts → public-dir.d.ts} +5 -5
- package/dist/options/public-dir.js +37 -0
- package/dist/options/public-path.d.ts +18 -0
- package/dist/options/public-path.js +37 -0
- package/dist/options/video-codec.d.ts +1 -1
- package/dist/preprocess-audio-track.d.ts +3 -1
- package/dist/preprocess-audio-track.js +7 -7
- package/dist/pure.d.ts +3 -3
- package/dist/render-frames.d.ts +6 -0
- package/dist/render-frames.js +70 -29
- package/dist/render-media.d.ts +1 -0
- package/dist/render-media.js +5 -2
- package/dist/stitch-frames-to-video.d.ts +1 -1
- package/dist/stitch-frames-to-video.js +9 -9
- package/dist/stringify-ffmpeg-filter.d.ts +3 -2
- package/dist/stringify-ffmpeg-filter.js +56 -14
- package/dist/take-frame-and-compose.d.ts +1 -0
- package/dist/validate-output-filename.d.ts +1 -1
- package/dist/x264-preset.d.ts +15 -0
- package/dist/x264-preset.js +26 -1
- package/package.json +9 -9
- package/dist/can-concatenate-seamlessly.d.ts +0 -3
- package/dist/can-concatenate-seamlessly.js +0 -7
- package/dist/options/separate-audio-to.js +0 -31
- package/dist/should-seamless.d.ts +0 -3
- package/dist/should-seamless.js +0 -7
- package/dist/supported-audio-codecs.d.ts +0 -13
- package/dist/supported-audio-codecs.js +0 -16
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { TRenderAsset } from 'remotion/no-react';
|
|
2
2
|
import type { LogLevel } from '../log-level';
|
|
3
|
+
import type { FrameAndAssets } from '../render-frames';
|
|
3
4
|
import type { RenderMediaOnDownload } from './download-and-map-assets-to-file';
|
|
4
5
|
import type { DownloadMap } from './download-map';
|
|
5
6
|
export declare const convertAssetsToFileUrls: ({ assets, onDownload, downloadMap, indent, logLevel, }: {
|
|
6
|
-
assets:
|
|
7
|
+
assets: FrameAndAssets[];
|
|
7
8
|
onDownload: RenderMediaOnDownload;
|
|
8
9
|
downloadMap: DownloadMap;
|
|
9
10
|
indent: boolean;
|
|
@@ -13,8 +13,8 @@ const convertAssetsToFileUrls = async ({ assets, onDownload, downloadMap, indent
|
|
|
13
13
|
const chunks = chunk(assets, 1000);
|
|
14
14
|
const results = [];
|
|
15
15
|
for (const ch of chunks) {
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const assetPromises = ch.map((frame) => {
|
|
17
|
+
const frameAssetPromises = frame.assets.map((a) => {
|
|
18
18
|
return (0, download_and_map_assets_to_file_1.downloadAndMapAssetsToFileUrl)({
|
|
19
19
|
renderAsset: a,
|
|
20
20
|
onDownload,
|
|
@@ -22,8 +22,10 @@ const convertAssetsToFileUrls = async ({ assets, onDownload, downloadMap, indent
|
|
|
22
22
|
indent,
|
|
23
23
|
logLevel,
|
|
24
24
|
});
|
|
25
|
-
})
|
|
26
|
-
|
|
25
|
+
});
|
|
26
|
+
return Promise.all(frameAssetPromises);
|
|
27
|
+
});
|
|
28
|
+
const result = await Promise.all(assetPromises);
|
|
27
29
|
results.push(result);
|
|
28
30
|
}
|
|
29
31
|
return results.flat(1);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TRenderAsset } from 'remotion/no-react';
|
|
2
1
|
import { OffthreadVideoServerEmitter } from '../offthread-video-server';
|
|
2
|
+
import type { FrameAndAssets } from '../render-frames';
|
|
3
3
|
import type { RenderMediaOnDownload } from './download-and-map-assets-to-file';
|
|
4
4
|
export type AudioChannelsAndDurationResultCache = {
|
|
5
5
|
channels: number;
|
|
@@ -41,10 +41,14 @@ export type DownloadMap = {
|
|
|
41
41
|
isPreventedFromCleanup: () => boolean;
|
|
42
42
|
};
|
|
43
43
|
export type RenderAssetInfo = {
|
|
44
|
-
assets:
|
|
44
|
+
assets: FrameAndAssets[];
|
|
45
45
|
imageSequenceName: string;
|
|
46
46
|
firstFrameIndex: number;
|
|
47
47
|
downloadMap: DownloadMap;
|
|
48
|
+
chunkLengthInSeconds: number;
|
|
49
|
+
trimLeftOffset: number;
|
|
50
|
+
trimRightOffset: number;
|
|
51
|
+
forSeamlessAacConcatenation: boolean;
|
|
48
52
|
};
|
|
49
53
|
export declare const makeDownloadMap: () => DownloadMap;
|
|
50
54
|
export declare const cleanDownloadMap: (downloadMap: DownloadMap) => void;
|
|
@@ -32,7 +32,7 @@ const ffmpegIsOneOfFrames = ({ frames, trimLeft, fps, }) => {
|
|
|
32
32
|
})
|
|
33
33
|
.join('+');
|
|
34
34
|
};
|
|
35
|
-
const ffmpegBuildVolumeExpression = (arr, delay, fps) => {
|
|
35
|
+
const ffmpegBuildVolumeExpression = ({ arr, delay, fps, }) => {
|
|
36
36
|
if (arr.length === 0) {
|
|
37
37
|
throw new Error('Volume array expression should never have length 0');
|
|
38
38
|
}
|
|
@@ -41,7 +41,7 @@ const ffmpegBuildVolumeExpression = (arr, delay, fps) => {
|
|
|
41
41
|
}
|
|
42
42
|
const [first, ...rest] = arr;
|
|
43
43
|
const [volume, frames] = first;
|
|
44
|
-
return ffmpegIfOrElse(ffmpegIsOneOfFrames({ frames, trimLeft: delay, fps }), String(volume), ffmpegBuildVolumeExpression(rest, delay, fps));
|
|
44
|
+
return ffmpegIfOrElse(ffmpegIsOneOfFrames({ frames, trimLeft: delay, fps }), String(volume), ffmpegBuildVolumeExpression({ arr: rest, delay, fps }));
|
|
45
45
|
};
|
|
46
46
|
const ffmpegVolumeExpression = ({ volume, fps, trimLeft, allowAmplificationDuringRender, }) => {
|
|
47
47
|
const maxVolume = allowAmplificationDuringRender ? Infinity : 1;
|
|
@@ -85,7 +85,11 @@ const ffmpegVolumeExpression = ({ volume, fps, trimLeft, allowAmplificationDurin
|
|
|
85
85
|
.map((key) => [Number(key), volumeMap[key]])
|
|
86
86
|
.sort((a, b) => a[1].length - b[1].length);
|
|
87
87
|
// Construct and tell FFMPEG it has to evaluate expression on each frame
|
|
88
|
-
const expression = ffmpegBuildVolumeExpression(
|
|
88
|
+
const expression = ffmpegBuildVolumeExpression({
|
|
89
|
+
arr: volumeArray,
|
|
90
|
+
delay: trimLeft,
|
|
91
|
+
fps,
|
|
92
|
+
});
|
|
89
93
|
return {
|
|
90
94
|
eval: 'frame',
|
|
91
95
|
value: `'${expression}'`,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { MediaAsset } from './assets/types';
|
|
2
2
|
import type { FilterWithoutPaddingApplied } from './stringify-ffmpeg-filter';
|
|
3
|
-
export declare const calculateFfmpegFilter: ({ asset, fps,
|
|
3
|
+
export declare const calculateFfmpegFilter: ({ asset, fps, channels, assetDuration, trimLeftOffset, trimRightOffset, chunkLengthInSeconds, forSeamlessAacConcatenation, }: {
|
|
4
4
|
asset: MediaAsset;
|
|
5
5
|
fps: number;
|
|
6
|
-
durationInFrames: number;
|
|
7
6
|
channels: number;
|
|
8
7
|
assetDuration: number | null;
|
|
8
|
+
trimLeftOffset: number;
|
|
9
|
+
trimRightOffset: number;
|
|
10
|
+
chunkLengthInSeconds: number;
|
|
9
11
|
forSeamlessAacConcatenation: boolean;
|
|
10
12
|
}) => FilterWithoutPaddingApplied | null;
|
|
@@ -2,36 +2,29 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateFfmpegFilter = void 0;
|
|
4
4
|
const flatten_volume_array_1 = require("./assets/flatten-volume-array");
|
|
5
|
-
const combine_audio_1 = require("./combine-audio");
|
|
6
|
-
const sample_rate_1 = require("./sample-rate");
|
|
7
5
|
const stringify_ffmpeg_filter_1 = require("./stringify-ffmpeg-filter");
|
|
8
|
-
const calculateFfmpegFilter = ({ asset, fps,
|
|
6
|
+
const calculateFfmpegFilter = ({ asset, fps, channels, assetDuration, trimLeftOffset, trimRightOffset, chunkLengthInSeconds, forSeamlessAacConcatenation, }) => {
|
|
9
7
|
if (channels === 0) {
|
|
10
8
|
return null;
|
|
11
9
|
}
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const assetTrimRight = forSeamlessAacConcatenation
|
|
18
|
-
? (0, combine_audio_1.getClosestAlignedTime)(((asset.trimLeft + asset.duration * asset.playbackRate) / fps) *
|
|
19
|
-
1000000) /
|
|
20
|
-
1000000 +
|
|
21
|
-
2 * (1024 / sample_rate_1.DEFAULT_SAMPLE_RATE)
|
|
22
|
-
: assetTrimLeft + (asset.duration * asset.playbackRate) / fps;
|
|
10
|
+
const trimLeft = (asset.trimLeft * asset.playbackRate) / fps +
|
|
11
|
+
trimLeftOffset * asset.playbackRate;
|
|
12
|
+
const trimRight = trimLeft +
|
|
13
|
+
(asset.duration * asset.playbackRate) / fps +
|
|
14
|
+
trimRightOffset * asset.playbackRate;
|
|
23
15
|
return (0, stringify_ffmpeg_filter_1.stringifyFfmpegFilter)({
|
|
24
16
|
channels,
|
|
25
17
|
startInVideo: asset.startInVideo,
|
|
26
|
-
trimLeft
|
|
27
|
-
trimRight
|
|
18
|
+
trimLeft,
|
|
19
|
+
trimRight,
|
|
28
20
|
volume: (0, flatten_volume_array_1.flattenVolumeArray)(asset.volume),
|
|
29
21
|
fps,
|
|
30
22
|
playbackRate: asset.playbackRate,
|
|
31
|
-
durationInFrames,
|
|
32
23
|
assetDuration,
|
|
33
24
|
allowAmplificationDuringRender: asset.allowAmplificationDuringRender,
|
|
34
25
|
toneFrequency: asset.toneFrequency,
|
|
26
|
+
chunkLengthInSeconds,
|
|
27
|
+
forSeamlessAacConcatenation,
|
|
35
28
|
});
|
|
36
29
|
};
|
|
37
30
|
exports.calculateFfmpegFilter = calculateFfmpegFilter;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const gLibCErrorMessage: (libCString: string) => string | null;
|
|
3
|
-
export declare const checkNodeVersionAndWarnAboutRosetta: (logLevel: LogLevel, indent: boolean) => void;
|
|
1
|
+
export declare const checkNodeVersionAndWarnAboutRosetta: () => void;
|
|
@@ -1,42 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkNodeVersionAndWarnAboutRosetta =
|
|
4
|
-
const
|
|
5
|
-
const gLibCErrorMessage = (libCString) => {
|
|
6
|
-
const split = libCString.split('.');
|
|
7
|
-
if (split.length !== 2) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
if (split[0] === '2' && Number(split[1]) >= 35) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
if (Number(split[0]) > 2) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return `Rendering videos requires glibc 2.35 or higher. Your system has glibc ${libCString}.`;
|
|
17
|
-
};
|
|
18
|
-
exports.gLibCErrorMessage = gLibCErrorMessage;
|
|
19
|
-
const checkLibCRequirement = (logLevel, indent) => {
|
|
20
|
-
const { report } = process;
|
|
21
|
-
if (report) {
|
|
22
|
-
// @ts-expect-error no types
|
|
23
|
-
const { glibcVersionRuntime } = report.getReport().header;
|
|
24
|
-
if (!glibcVersionRuntime) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const error = (0, exports.gLibCErrorMessage)(glibcVersionRuntime);
|
|
28
|
-
if (error) {
|
|
29
|
-
logger_1.Log.warn({ logLevel, indent }, error);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const checkNodeVersionAndWarnAboutRosetta = (logLevel, indent) => {
|
|
3
|
+
exports.checkNodeVersionAndWarnAboutRosetta = void 0;
|
|
4
|
+
const checkNodeVersionAndWarnAboutRosetta = () => {
|
|
34
5
|
const version = process.version.replace('v', '').split('.');
|
|
35
6
|
const majorVersion = Number(version[0]);
|
|
36
7
|
const requiredNodeVersion = 16;
|
|
37
8
|
if (majorVersion < 16) {
|
|
38
9
|
throw new Error(`Remotion requires at least Node ${requiredNodeVersion}. You currently have ${process.version}. Update your node version to ${requiredNodeVersion} to use Remotion.`);
|
|
39
10
|
}
|
|
40
|
-
checkLibCRequirement(logLevel, indent);
|
|
41
11
|
};
|
|
42
12
|
exports.checkNodeVersionAndWarnAboutRosetta = checkNodeVersionAndWarnAboutRosetta;
|