Chapter 730: rotateAndResizeVideoFrame()
Core Idea
:::warning We are phasing out Remotion WebCodecs and are moving to Mediabunny!
Key Concepts
- API
- frame
- rotation
- resizeOperation
- needsToBeMultipleOfTwo?
- Behavior
- Memory Management
- See also
Code Examples
// Assume you have a VideoFrame object
declare const frame: VideoFrame;
const rotatedFrame = rotateAndResizeVideoFrame({
frame,
rotation: 90,
resizeOperation: null,
});
console.log('Original dimensions:', frame.displayWidth, 'x', frame.displayHeight);
console.log('Rotated dimensions:', rotatedFrame.displayWidth, 'x', rotatedFrame.displayHeight);
- What it demonstrates: Usage pattern for rotateAndResizeVideoFrame() from the official docs.
Key Takeaways
- Understand api when working with rotateAndResizeVideoFrame().
- Understand frame when working with rotateAndResizeVideoFrame().
- Understand rotation when working with rotateAndResizeVideoFrame().
- Understand resizeoperation when working with rotateAndResizeVideoFrame().
- Understand needstobemultipleoftwo? when working with rotateAndResizeVideoFrame().
Connects To
- Buffer Writer: related page in the WebCodecs (@remotion/webcodecs) section.
- can Copy Audio Track: related page in the WebCodecs (@remotion/webcodecs) section.
- can Copy Video Track: related page in the WebCodecs (@remotion/webcodecs) section.