Skip to content

🎥 Make videos programmatically with React

fix cancelsignals

Jonny Burgerfda76b385975
diff --git a/packages/lambda/src/functions/helpers/concat-videos.ts b/packages/lambda/src/functions/helpers/concat-videos.ts
index a62c6a625e..41b382f432 100644
--- a/packages/lambda/src/functions/helpers/concat-videos.ts
+++ b/packages/lambda/src/functions/helpers/concat-videos.ts
@@ -1,4 +1,4 @@
-import type {AudioCodec, LogLevel} from '@remotion/renderer';
+import type {AudioCodec, CancelSignal, LogLevel} from '@remotion/renderer';
import {RenderInternals} from '@remotion/renderer';
import fs, {createWriteStream, promises} from 'node:fs';
import path, {join} from 'node:path';
@@ -192,6 +192,7 @@ export const concatVideosS3 = async ({
logLevel,
framesPerLambda,
binariesDirectory,
+ cancelSignal,
}: {
onProgress: (frames: number) => void;
numberOfFrames: number;
@@ -205,6 +206,7 @@ export const concatVideosS3 = async ({
logLevel: LogLevel;
framesPerLambda: number;
binariesDirectory: string | null;
+ cancelSignal: CancelSignal | undefined;
}) => {
const outfile = join(
RenderInternals.tmpDir(REMOTION_CONCATED_TOKEN),
@@ -230,6 +232,7 @@ export const concatVideosS3 = async ({
logLevel,
chunkDurationInSeconds,
binariesDirectory,
+ cancelSignal,
});
combine.end();
diff --git a/packages/lambda/src/functions/helpers/merge-chunks.ts b/packages/lambda/src/functions/helpers/merge-chunks.ts
index 97e5455c0f..32c41b8851 100644
--- a/packages/lambda/src/functions/helpers/merge-chunks.ts
+++ b/packages/lambda/src/functions/helpers/merge-chunks.ts
@@ -171,6 +171,7 @@ export const mergeChunksAndFinishRender = async (options: {
logLevel: options.logLevel,
framesPerLambda: options.framesPerLambda,
binariesDirectory: options.binariesDirectory,
+ cancelSignal: undefined,
});
const encodingStop = Date.now();
diff --git a/packages/lambda/src/test/integration/renders/gif.test.ts b/packages/lambda/src/test/integration/renders/gif.test.ts
index 594b2ac313..fdd5138cdb 100644
--- a/packages/lambda/src/test/integration/renders/gif.test.ts
+++ b/packages/lambda/src/test/integration/renders/gif.test.ts
@@ -112,6 +112,7 @@ test('Should make a distributed GIF', async () => {
indent: false,
logLevel: 'info',
binariesDirectory: null,
+ cancelSignal: undefined,
});
unlinkSync(out);
expect(probe.stderr).toMatch(/Video: gif, bgra, 1080x1080/);
diff --git a/packages/lambda/src/test/integration/renders/other-bucket.test.ts b/packages/lambda/src/test/integration/renders/other-bucket.test.ts
index ca7f0d4d40..fe9a74f657 100644
--- a/packages/lambda/src/test/integration/renders/other-bucket.test.ts
+++ b/packages/lambda/src/test/integration/renders/other-bucket.test.ts
@@ -110,6 +110,7 @@ test('Should be able to render to another bucket', async () => {
stdin: file,
},
binariesDirectory: null,
+ cancelSignal: undefined,
});
expect(probe.stderr).toMatch(/Stream #0:0/);
expect(probe.stderr).toMatch(/Video: h264/);
diff --git a/packages/lambda/src/test/integration/renders/silent-audio.test.ts b/packages/lambda/src/test/integration/renders/silent-audio.test.ts
index 8261b23199..6ebb87a567 100644
--- a/packages/lambda/src/test/integration/renders/silent-audio.test.ts
+++ b/packages/lambda/src/test/integration/renders/silent-audio.test.ts
@@ -107,6 +107,7 @@ test('Should add silent audio if there is no audio', async () => {
stdin: file,
},
binariesDirectory: null,
+ cancelSignal: undefined,
});
expect(probe.stderr).toMatch(/Stream #0:0/);
expect(probe.stderr).toMatch(/Video: h264/);
diff --git a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
index 7fccdfa48a..3b95423c35 100644
--- a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
+++ b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts
@@ -116,6 +116,7 @@ test('Should make a transparent video', async () => {
indent: false,
logLevel: 'info',
binariesDirectory: null,
+ cancelSignal: undefined,
});
expect(probe.stderr).toMatch(/ALPHA_MODE(\s+): 1/);
expect(probe.stderr).toMatch(/Video: vp8, yuv420p/);