-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
@remotion/webcodecs
: new rotateAndResizeVideoFrame()
API
#5414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…esizeVideoFrame as public API Co-authored-by: JonnyBurger <[email protected]>
…deoFrame API Co-authored-by: JonnyBurger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify this in the docs:
It only returns a new VideoFrame if a transform has happened, otherwise it returns the original frame. Remember the user has to manually perform memory cleanup,
so the user may have to perform a check like
if (frames !== rotatedFrame) {
oldFrame.close()
}
… management Co-authored-by: JonnyBurger <[email protected]>
I've updated the documentation to clarify when the function returns the original frame vs a new frame, and added a dedicated Memory Management section with the exact cleanup pattern you suggested. The docs now clearly explain that users should check |
@remotion/webcodecs
: new rotateAndResizeVideoFrame()
API
This PR promotes the
rotateAndResizeVideoFrame()
function fromWebCodecsInternals
to a proper documented public API of@remotion/webcodecs
. The function now provides a clean interface for rotating and resizing video frames with improved usability.Changes Made
API Changes
rotateAndResizeVideoFrame
is now directly exported from@remotion/webcodecs
needsToBeMultipleOfTwo
is now optional with a default value offalse
WebCodecsInternals
to avoid breaking existing codeDocumentation
Testing
Usage Examples
API Reference
frame
: VideoFrame object to transformrotation
: Rotation angle in degrees (multiples of 90)resizeOperation
: Resize operation or nullneedsToBeMultipleOfTwo?
: Optional boolean for dimension constraints (default: false)The function supports all existing functionality while providing a more user-friendly interface with sensible defaults.
Fixes #5413.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.