remotion-multimedia

Extract duration and dimensions from audio and video files using Mediabunny.

57.9k|4.4k|Updated Jun 23, 2020
One-click install
npx skills add https://github.com/remotion-dev/remotion --skill remotion-multimedia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: remotion-multimedia
Source: https://github.com/remotion-dev/remotion/tree/main/packages/skills/skills/remotion-multimedia
Command: npx skills add https://github.com/remotion-dev/remotion --skill remotion-multimedia

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mediabunny.

What problem does it solve?

Developers working with browser-based video and audio often need quick access to media metadata like duration and dimensions without writing boilerplate code for each file type.

Core Features & Use Cases

  • Audio Duration: Retrieve the playback length of MP3, WAV, and other audio formats in seconds.
  • Video Duration: Extract the total runtime of MP4 and other video files for timeline calculations.
  • Video Dimensions: Read the width and height of video files to match composition aspect ratios.
  • Use Case: When building a Remotion video, automatically detect the duration of imported footage and resize the composition to match the source media dimensions.

Quick Start

Use the remotion-multimedia skill to get the duration and dimensions of the video file at staticFile('footage.mp4').

Frequently Asked Questions about remotion-multimedia

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get video duration in JavaScript with Mediabunny?

Create an Input instance with ALL_FORMATS and a UrlSource, then call input.computeDuration() to retrieve the playback length in seconds. The method works in browser, Node.js, and Bun environments.

How to extract video width and height in the browser?

Use input.getPrimaryVideoTrack() to access the video track, then read videoTrack.displayWidth and videoTrack.displayHeight. This returns the actual rendered dimensions of the video file.

Does Mediabunny work with local files in Node.js?

Yes, Mediabunny supports local files in Node.js and Bun by using FileSource instead of UrlSource. Pass a File object directly to the Input constructor for filesystem-based media processing.

Can I get audio duration with Mediabunny?

Mediabunny handles audio duration extraction through the same Input.computeDuration() method used for video. It supports MP3, WAV, and other formats registered in ALL_FORMATS.

Why does getPrimaryVideoTrack return undefined?

The method returns undefined when the input file contains no video stream, such as audio-only files or corrupted media. Check the file format and verify the source URL is accessible before calling the method.