Capítulo 730 de 988

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

  1. Understand api when working with rotateAndResizeVideoFrame().
  2. Understand frame when working with rotateAndResizeVideoFrame().
  3. Understand rotation when working with rotateAndResizeVideoFrame().
  4. Understand resizeoperation when working with rotateAndResizeVideoFrame().
  5. 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.