@remotion/lambda 4.0.133 → 4.0.134
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/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -4
- package/dist/functions/helpers/concat-videos.d.ts +2 -1
- package/dist/functions/helpers/concat-videos.js +4 -3
- package/dist/functions/helpers/merge-chunks.js +4 -0
- package/dist/functions/helpers/render-has-audio-video.js +4 -1
- package/dist/functions/merge.js +0 -3
- package/dist/functions/renderer.js +15 -4
- package/dist/shared/constants.d.ts +2 -1
- package/dist/shared/invoke-webhook.d.ts +2 -0
- package/package.json +8 -8
- package/remotionlambda-arm64.zip +0 -0
|
@@ -12,7 +12,7 @@ export declare const getAllFilesS3: ({ bucket, expectedFiles, outdir, renderId,
|
|
|
12
12
|
onErrors: (errors: EnhancedErrorInfo[]) => void;
|
|
13
13
|
logLevel: LogLevel;
|
|
14
14
|
}) => Promise<string[]>;
|
|
15
|
-
export declare const concatVideosS3: ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, audioBitrate, logLevel, framesPerLambda, binariesDirectory, cancelSignal, preferLossless, }: {
|
|
15
|
+
export declare const concatVideosS3: ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, audioBitrate, logLevel, framesPerLambda, binariesDirectory, cancelSignal, preferLossless, muted, }: {
|
|
16
16
|
onProgress: (frames: number) => void;
|
|
17
17
|
numberOfFrames: number;
|
|
18
18
|
codec: LambdaCodec;
|
|
@@ -27,6 +27,7 @@ export declare const concatVideosS3: ({ onProgress, numberOfFrames, codec, fps,
|
|
|
27
27
|
binariesDirectory: string | null;
|
|
28
28
|
cancelSignal: CancelSignal | undefined;
|
|
29
29
|
preferLossless: boolean;
|
|
30
|
+
muted: boolean;
|
|
30
31
|
}) => Promise<{
|
|
31
32
|
outfile: string;
|
|
32
33
|
cleanupChunksProm: Promise<void>;
|
|
@@ -88,7 +88,7 @@ const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expect
|
|
|
88
88
|
.map((file) => getChunkDownloadOutputLocation({ outdir, file })));
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
-
renderer_1.RenderInternals.Log.info({ indent: false, logLevel },
|
|
91
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `Found ${filesInBucket.length} out of ${expectedFiles}`);
|
|
92
92
|
const errors = (await (0, inspect_errors_1.inspectErrors)({
|
|
93
93
|
bucket,
|
|
94
94
|
contents: errorContents,
|
|
@@ -134,7 +134,7 @@ const getAllFilesS3 = ({ bucket, expectedFiles, outdir, renderId, region, expect
|
|
|
134
134
|
});
|
|
135
135
|
};
|
|
136
136
|
exports.getAllFilesS3 = getAllFilesS3;
|
|
137
|
-
const concatVideosS3 = async ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, audioBitrate, logLevel, framesPerLambda, binariesDirectory, cancelSignal, preferLossless, }) => {
|
|
137
|
+
const concatVideosS3 = async ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, audioBitrate, logLevel, framesPerLambda, binariesDirectory, cancelSignal, preferLossless, muted, }) => {
|
|
138
138
|
const outfile = (0, node_path_1.join)(renderer_1.RenderInternals.tmpDir(constants_1.REMOTION_CONCATED_TOKEN), `concat.${renderer_1.RenderInternals.getFileExtensionFromCodec(codec, audioCodec)}`);
|
|
139
139
|
const combine = (0, timer_1.timer)('Combine chunks', logLevel);
|
|
140
140
|
const filelistDir = renderer_1.RenderInternals.tmpDir(constants_1.REMOTION_FILELIST_TOKEN);
|
|
@@ -147,7 +147,7 @@ const concatVideosS3 = async ({ onProgress, numberOfFrames, codec, fps, numberOf
|
|
|
147
147
|
});
|
|
148
148
|
const seamlessAudio = (0, can_concat_seamlessly_1.canConcatAudioSeamlessly)(resolvedAudioCodec, framesPerLambda);
|
|
149
149
|
const seamlessVideo = (0, can_concat_seamlessly_1.canConcatVideoSeamlessly)(codec);
|
|
150
|
-
await renderer_1.RenderInternals.
|
|
150
|
+
await renderer_1.RenderInternals.combineChunks({
|
|
151
151
|
files,
|
|
152
152
|
filelistDir,
|
|
153
153
|
output: outfile,
|
|
@@ -165,6 +165,7 @@ const concatVideosS3 = async ({ onProgress, numberOfFrames, codec, fps, numberOf
|
|
|
165
165
|
cancelSignal,
|
|
166
166
|
seamlessAudio,
|
|
167
167
|
seamlessVideo,
|
|
168
|
+
muted,
|
|
168
169
|
});
|
|
169
170
|
combine.end();
|
|
170
171
|
const cleanupChunksProm = node_fs_1.default.promises.rm(outdir, {
|
|
@@ -99,6 +99,9 @@ const mergeChunksAndFinishRender = async (options) => {
|
|
|
99
99
|
compositionStart: options.compositionStart,
|
|
100
100
|
});
|
|
101
101
|
const encodingStart = Date.now();
|
|
102
|
+
if (options.renderMetadata.type === 'still') {
|
|
103
|
+
throw new Error('Cannot merge stills');
|
|
104
|
+
}
|
|
102
105
|
const { outfile, cleanupChunksProm } = await (0, concat_videos_1.concatVideosS3)({
|
|
103
106
|
onProgress,
|
|
104
107
|
numberOfFrames: options.frameCountLength,
|
|
@@ -114,6 +117,7 @@ const mergeChunksAndFinishRender = async (options) => {
|
|
|
114
117
|
binariesDirectory: options.binariesDirectory,
|
|
115
118
|
cancelSignal: undefined,
|
|
116
119
|
preferLossless: options.preferLossless,
|
|
120
|
+
muted: options.renderMetadata.muted,
|
|
117
121
|
});
|
|
118
122
|
const encodingStop = Date.now();
|
|
119
123
|
const outputSize = fs_1.default.statSync(outfile);
|
|
@@ -6,10 +6,13 @@ const lambdaRenderHasAudioVideo = (renderMetadata) => {
|
|
|
6
6
|
if (renderMetadata.type === 'still') {
|
|
7
7
|
throw new Error('Cannot merge stills');
|
|
8
8
|
}
|
|
9
|
+
const support = renderer_1.RenderInternals.codecSupportsMedia(renderMetadata.codec);
|
|
9
10
|
const hasVideo = renderMetadata
|
|
10
11
|
? !renderer_1.RenderInternals.isAudioCodec(renderMetadata.codec)
|
|
11
12
|
: false;
|
|
12
|
-
const hasAudio = renderMetadata
|
|
13
|
+
const hasAudio = renderMetadata
|
|
14
|
+
? !renderMetadata.muted && support.audio
|
|
15
|
+
: false;
|
|
13
16
|
return {
|
|
14
17
|
hasAudio,
|
|
15
18
|
hasVideo,
|
package/dist/functions/merge.js
CHANGED
|
@@ -23,9 +23,6 @@ const mergeHandler = async (params, options) => {
|
|
|
23
23
|
if (!renderMetadata.codec) {
|
|
24
24
|
throw new Error('expected codec');
|
|
25
25
|
}
|
|
26
|
-
if (renderMetadata.type === 'still') {
|
|
27
|
-
throw new Error('Cannot merge stills');
|
|
28
|
-
}
|
|
29
26
|
const { key, renderBucketName, customCredentials } = (0, expected_out_name_1.getExpectedOutName)(renderMetadata, params.bucketName, typeof params.outName === 'string' || typeof params.outName === 'undefined'
|
|
30
27
|
? null
|
|
31
28
|
: (_b = (_a = params.outName) === null || _a === void 0 ? void 0 : _a.s3OutputProvider) !== null && _b !== void 0 ? _b : null);
|
|
@@ -82,11 +82,22 @@ const renderHandler = async (params, options, logs) => {
|
|
|
82
82
|
? renderer_1.RenderInternals.getExtensionFromAudioCodec(audioCodec)
|
|
83
83
|
: null;
|
|
84
84
|
const videoOutputLocation = node_path_1.default.join(outdir, `${chunk}.${videoExtension}`);
|
|
85
|
-
const
|
|
85
|
+
const willRenderAudioEval = renderer_1.RenderInternals.getShouldRenderAudio({
|
|
86
|
+
assetsInfo: null,
|
|
87
|
+
codec: params.codec,
|
|
88
|
+
enforceAudioTrack: true,
|
|
89
|
+
muted: params.muted,
|
|
90
|
+
});
|
|
91
|
+
if (willRenderAudioEval === 'maybe') {
|
|
92
|
+
throw new Error('Cannot determine whether to render audio or not');
|
|
93
|
+
}
|
|
94
|
+
const audioOutputLocation = willRenderAudioEval === 'no'
|
|
86
95
|
? null
|
|
87
|
-
:
|
|
88
|
-
?
|
|
89
|
-
:
|
|
96
|
+
: renderer_1.RenderInternals.isAudioCodec(params.codec)
|
|
97
|
+
? null
|
|
98
|
+
: audioExtension
|
|
99
|
+
? node_path_1.default.join(outdir, `${chunk}.${audioExtension}`)
|
|
100
|
+
: null;
|
|
90
101
|
const resolvedProps = await resolvedPropsPromise;
|
|
91
102
|
const serializedInputPropsWithCustomSchema = await inputPropsPromise;
|
|
92
103
|
await new Promise((resolve, reject) => {
|
|
@@ -322,12 +322,14 @@ export type EncodingProgress = {
|
|
|
322
322
|
type Discriminated = {
|
|
323
323
|
type: 'still';
|
|
324
324
|
imageFormat: StillImageFormat;
|
|
325
|
+
codec: null;
|
|
325
326
|
} | {
|
|
326
327
|
type: 'video';
|
|
327
328
|
imageFormat: VideoImageFormat;
|
|
328
329
|
muted: boolean;
|
|
329
330
|
frameRange: [number, number];
|
|
330
331
|
everyNthFrame: number;
|
|
332
|
+
codec: LambdaCodec;
|
|
331
333
|
};
|
|
332
334
|
export type RenderMetadata = Discriminated & {
|
|
333
335
|
siteId: string;
|
|
@@ -337,7 +339,6 @@ export type RenderMetadata = Discriminated & {
|
|
|
337
339
|
estimatedTotalLambdaInvokations: number;
|
|
338
340
|
estimatedRenderLambdaInvokations: number;
|
|
339
341
|
compositionId: string;
|
|
340
|
-
codec: LambdaCodec | null;
|
|
341
342
|
audioCodec: AudioCodec | null;
|
|
342
343
|
inputProps: SerializedInputProps;
|
|
343
344
|
framesPerLambda: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/lambda",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.134",
|
|
4
4
|
"description": "Distributed renderer for Remotion based on AWS Lambda",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"aws-policies": "^1.0.1",
|
|
27
27
|
"mime-types": "2.1.34",
|
|
28
28
|
"zod": "3.22.3",
|
|
29
|
-
"@remotion/
|
|
30
|
-
"@remotion/bundler": "4.0.
|
|
31
|
-
"remotion": "4.0.
|
|
32
|
-
"@remotion/
|
|
29
|
+
"@remotion/cli": "4.0.134",
|
|
30
|
+
"@remotion/bundler": "4.0.134",
|
|
31
|
+
"remotion": "4.0.134",
|
|
32
|
+
"@remotion/renderer": "4.0.134"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@jonny/eslint-config": "3.0.276",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"ts-node": "^10.8.0",
|
|
45
45
|
"vitest": "0.31.1",
|
|
46
46
|
"zip-lib": "^0.7.2",
|
|
47
|
-
"@remotion/bundler": "4.0.
|
|
48
|
-
"@remotion/compositor-linux-arm64-gnu": "4.0.
|
|
47
|
+
"@remotion/bundler": "4.0.134",
|
|
48
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.134"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@remotion/bundler": "4.0.
|
|
51
|
+
"@remotion/bundler": "4.0.134"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
package/remotionlambda-arm64.zip
CHANGED
|
Binary file
|