guanyang/open-agent-hub / skills/remotion-multimedia
remotion-multimedia
VerifiedInteracting with Mediabunny
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 705 B |
| agents/openai.yaml | config | 317 B |
| assets/remotion-icon.png | binary | 1.3 KB |
| assets/remotion-icon.svg | other | 1.3 KB |
| get-audio-duration.md | markdown | 1.5 KB |
| get-video-dimensions.md | markdown | 1.8 KB |
| get-video-duration.md | markdown | 1.4 KB |
get-video-dimensions.md
View on GitHub---
name: get-video-dimensions
description: Getting the width and height of a video file with Mediabunny
metadata:
tags: dimensions, width, height, resolution, size, video
---
# Getting video dimensions with Mediabunny
Mediabunny can extract the width and height of a video file. It works in browser, Node.js, and Bun environments.
## Getting video dimensions
```tsx
import { Input, ALL_FORMATS, UrlSource } from "mediabunny";
export const getVideoDimensions = async (src: string) => {
const input = new Input({
formats: ALL_FORMATS,
source: new UrlSource(src),
});
const videoTrack = await input.getPrimaryVideoTrack();
if (!videoTrack) {
throw new Error("No video track found");
}
return {
width: videoTrack.displayWidth,
height: videoTrack.displayHeight,
};
};
```
## Usage
```tsx
const dimensions = await getVideoDimensions("https://remotion.media/video.mp4");
console.log(dimensions.width); // e.g. 1920
console.log(dimensions.height); // e.g. 1080
```
## Using with local files
For a `File` from a file input or drag and drop, use `BlobSource` instead of `UrlSource`:
```tsx
import { Input, ALL_FORMATS, BlobSource } from "mediabunny";
const input = new Input({
formats: ALL_FORMATS,
source: new BlobSource(file), // File object from input or drag-drop
});
const videoTrack = await input.getPrimaryVideoTrack();
if (!videoTrack) {
throw new Error("No video track found");
}
const width = videoTrack.displayWidth;
const height = videoTrack.displayHeight;
```
In Node.js and Bun, use `new FilePathSource(path)` to read a file from disk, and call `input.dispose()` when done.
## Using with staticFile in Remotion
```tsx
import { staticFile } from "remotion";
const dimensions = await getVideoDimensions(staticFile("video.mp4"));
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |