Skip to content

🎥 Make videos programmatically with React

fix mirroring

Jonny Burger29797e30b452
diff --git a/packages/convert/app/components/ConvertUi.tsx b/packages/convert/app/components/ConvertUi.tsx
index af529070c7..2ac39803f8 100644
--- a/packages/convert/app/components/ConvertUi.tsx
+++ b/packages/convert/app/components/ConvertUi.tsx
@@ -286,7 +286,6 @@ export default function ConvertUI({
supportedConfigs !== null &&
isReencoding({supportedConfigs, videoConfigIndex})
}
- userRotation={userRotation}
/>
<div className="h-2" />
<Button className="block w-full" type="button" onClick={cancel}>
@@ -309,7 +308,6 @@ export default function ConvertUI({
supportedConfigs !== null &&
isReencoding({supportedConfigs, videoConfigIndex})
}
- userRotation={userRotation}
/>
<div className="h-2" />
<ConversionDone {...{container, name, setState, state, setSrc}} />
diff --git a/packages/convert/app/components/flip-video.ts b/packages/convert/app/components/flip-video.ts
index 784f770fc6..0b893de1b5 100644
--- a/packages/convert/app/components/flip-video.ts
+++ b/packages/convert/app/components/flip-video.ts
@@ -28,7 +28,7 @@ export const flipVideoFrame = ({
return new VideoFrame(canvas, {
displayHeight: frame.displayHeight,
displayWidth: frame.displayWidth,
- duration: frame.duration as number,
+ duration: frame.duration ?? 0,
timestamp: frame.timestamp,
});
};
diff --git a/packages/webcodecs/src/on-frame.ts b/packages/webcodecs/src/on-frame.ts
index 4f2524ff84..7f9a72b129 100644
--- a/packages/webcodecs/src/on-frame.ts
+++ b/packages/webcodecs/src/on-frame.ts
@@ -46,13 +46,13 @@ export const onFrame = async ({
if (userProcessedFrame.timestamp !== rotated.timestamp) {
throw new Error(
- `Returned VideoFrame of track ${track.trackId} has different timestamp (${userProcessedFrame.timestamp}) than the input frame (${userProcessedFrame.timestamp}). When calling new VideoFrame(), pass {timestamp: frame.timestamp} as second argument`,
+ `Returned VideoFrame of track ${track.trackId} has different timestamp (${userProcessedFrame.timestamp}) than the input frame (${rotated.timestamp}). When calling new VideoFrame(), pass {timestamp: frame.timestamp} as second argument`,
);
}
- if (userProcessedFrame.duration !== rotated.duration) {
+ if ((userProcessedFrame.duration ?? 0) !== (rotated.duration ?? 0)) {
throw new Error(
- `Returned VideoFrame of track ${track.trackId} has different duration (${userProcessedFrame.duration}) than the input frame (${userProcessedFrame.duration}). When calling new VideoFrame(), pass {duration: frame.duration} as second argument`,
+ `Returned VideoFrame of track ${track.trackId} has different duration (${userProcessedFrame.duration}) than the input frame (${rotated.duration}). When calling new VideoFrame(), pass {duration: frame.duration} as second argument`,
);
}
diff --git a/packages/webcodecs/src/rotate-video-frame.ts b/packages/webcodecs/src/rotate-video-frame.ts
index 443cbce701..9023b3489b 100644
--- a/packages/webcodecs/src/rotate-video-frame.ts
+++ b/packages/webcodecs/src/rotate-video-frame.ts
@@ -49,7 +49,7 @@ export const rotateVideoFrame = ({
return new VideoFrame(canvas, {
displayHeight: height,
displayWidth: width,
- duration: frame.duration as number,
+ duration: frame.duration ?? 0,
timestamp: frame.timestamp,
});
};