Skip to content

🎥 Make videos programmatically with React

`@remotion/webcodecs`: Disallow invalid video operations

Jonny Burgerfe9ac1215424
diff --git a/packages/webcodecs/src/on-video-track.ts b/packages/webcodecs/src/on-video-track.ts
index 5e8cbd64cf..5eaa0a4078 100644
--- a/packages/webcodecs/src/on-video-track.ts
+++ b/packages/webcodecs/src/on-video-track.ts
@@ -91,6 +91,14 @@ export const makeVideoTrackHandler =
};
}
+ if (videoOperation.type !== 'reencode') {
+ throw new Error(
+ `Video track with ID ${track.trackId} could not be resolved with a valid operation. Received ${JSON.stringify(
+ videoOperation,
+ )}, but must be either "copy", "reencode", "drop" or "fail"`,
+ );
+ }
+
const videoEncoderConfig = await getVideoEncoderConfig({
codec: videoOperation.videoCodec,
height: track.displayAspectHeight,