Remotion Rule: Extract Frames
Remotion skill rule: Extract frames from videos at specific timestamps using Mediabunny. Part of the official Remotion Agent Skill for programmatic video in React.
Instalación lista para agent
Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.
npx -y tokrepo@latest install 79efb497-1545-4cdd-8db6-b492cdd5e23f --target codexEjecutar después de confirmar el plan con dry-run.
What it is
This is a Remotion skill rule that teaches AI coding agents how to extract frames from videos at specific timestamps using Mediabunny. It is part of the official Remotion Agent Skill for programmatic video creation in React.
The rule targets developers using Remotion for video generation who need to extract thumbnails, create filmstrips, or process individual frames from video files. It works with Claude Code, OpenAI Codex, and Cursor.
How it saves time or tokens
The rule activates automatically when the agent detects frame extraction work in a Remotion project. It provides the exact function signatures and usage patterns for Mediabunny's extractFrames API, eliminating the need to look up documentation or experiment with parameters.
With an estimated 500 tokens per activation, the rule adds minimal overhead to the agent's context while providing precise, actionable guidance.
How to use
- Install the Remotion skills collection with
npx skills add remotion-dev/skills. - Open your Remotion project and ask your coding agent to extract frames from a video.
- The rule activates automatically and the agent generates the correct Mediabunny code.
Example
import { extractFrames } from '@mediabunny/core';
const frames = await extractFrames({
src: 'https://example.com/video.mp4',
timestamps: [0, 5, 10, 15],
format: 'png',
width: 1920,
height: 1080,
});
for (const frame of frames) {
console.log(`Frame at ${frame.timestamp}s: ${frame.url}`);
}
Related on TokRepo
- AI tools for video -- Video production and processing tools
- AI tools for coding -- AI coding assistants and skills
Common pitfalls
- The extractFrames function requires a valid video URL accessible from the server. Local file paths must be served via a local HTTP server or use file:// protocol.
- Extracting many frames from a long video can be memory-intensive. Process frames in batches rather than requesting all timestamps at once.
- The output format (png vs jpg) affects file size and quality. Use png for lossless quality when compositing, jpg for smaller file sizes in thumbnails.
Preguntas frecuentes
Mediabunny is a media processing library used within the Remotion ecosystem for video manipulation tasks like frame extraction, transcoding, and thumbnail generation. It provides programmatic access to video processing functions that Remotion skills can leverage.
The rule is designed for Remotion projects and activates in that context. The Mediabunny extractFrames function itself can work independently, but the skill integration and automatic activation require a Remotion project setup.
There is no hard limit on the number of timestamps, but memory usage scales with frame count and resolution. For videos with many frames, process in batches of 10-20 timestamps to avoid memory pressure.
Mediabunny supports common video formats including MP4, WebM, and MOV. The underlying decoder handles most codecs supported by FFmpeg. Ensure your video file is accessible and properly encoded.
Yes. The extractFrames function accepts width and height parameters. You can extract frames at any resolution, independent of the source video resolution. Omitting these parameters uses the source video dimensions.
Referencias (3)
- Remotion Skills GitHub— Part of the official Remotion Agent Skill
- Remotion GitHub— Remotion is a framework for programmatic video in React
- Remotion Documentation— Mediabunny for media processing in Remotion
Relacionados en TokRepo
Fuente y agradecimientos
Created by Remotion. Licensed under MIT. remotion-dev/skills — Rule:
extract-frames
Part of the Remotion AI Skill collection on TokRepo.
Discusión
Activos relacionados
Remotion Rule: Videos
Remotion skill rule: Embedding videos in Remotion - trimming, volume, speed, looping, pitch. Part of the official Remotion Agent Skill for programmatic video in React.
Remotion Rule: Get Video Duration
Remotion skill rule: Getting the duration of a video file in seconds with Mediabunny. Part of the official Remotion Agent Skill for programmatic video in React.
Remotion Rule: Get Video Dimensions
Remotion skill rule: Getting the width and height of a video file with Mediabunny. Part of the official Remotion Agent Skill for programmatic video in React.
Remotion Rule: Get Audio Duration
Remotion skill rule: Getting the duration of an audio file in seconds with Mediabunny. Part of the official Remotion Agent Skill for programmatic video in React.