# get-video-dimensions

get-video-dimensions — a Claude rule that hands the agent working Mediabunny code for reading a video's width and height, whether the file sits behind a URL, on disk, or in Remotion.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 849 repo stars
- Author: coleam00
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/coleam00/second-brain-skills/tree/HEAD/.claude/skills/remotion/rules/get-video-dimensions.md
- Updated: 2026-01-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/get-video-dimensions

## What it does

Add this rule to a project and the model gets a ready snippet instead of guessing at the Mediabunny API. It creates an `Input` over `ALL_FORMATS`, fetches the primary video track, and returns `displayWidth` along with `displayHeight`. A file with no video track throws an error, which is how the guard on bad input works.

Three paths are covered: a remote URL through `UrlSource`, a local `File` through `FileSource` (the object you get from an input or a drop), and Remotion's `staticFile`. Mediabunny runs in the browser, in Node.js and in Bun, so the same helper serves either side.

\`UrlSource` cannot read something from disk, so use the `FileSource` variant there. Every snippet imports from `mediabunny`, meaning the package belongs in your dependencies; the rule itself only supplies code.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/get-video-dimensions.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/get-video-dimensions.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/get-video-dimensions.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/get-video-dimensions.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/get-video-dimensions.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/coleam00/second-brain-skills/tree/HEAD/.claude/skills/remotion/rules/get-video-dimensions.md

## When to use it
- read a clip's width and height before building the player layout
- check the resolution of a remote video in the browser
- feed real dimensions into a Remotion composition
- reject an upload that carries no video track
- measure a file dropped into the page

## Example prompts
- Write a helper that returns the width and height of a video URL, following the get-video-dimensions rule
- Use the `FileSource` snippet from `get-video-dimensions` for a file from drag-and-drop
- Get the dimensions of `staticFile("video.mp4")` in my Remotion component with the get-video-dimensions rule

## Similar
- [remotion-multimedia](https://affpapa.org/en/nevibecode/skills/remotion-multimedia.md) — skill · 3 installs
- [yyl-remotion-video](https://affpapa.org/en/nevibecode/skills/yyl-remotion-video.md) — skill · 549 installs
- [countdown-video](https://affpapa.org/en/nevibecode/skills/countdown-video.md) — skill · 3600 installs
- [wrapped-video](https://affpapa.org/en/nevibecode/skills/wrapped-video.md) — skill · 2700 installs
- [remotion-video-toolkit](https://affpapa.org/en/nevibecode/skills/remotion-video-toolkit.md) — skill · 804 installs
- [video-design](https://affpapa.org/en/nevibecode/skills/video-design.md) — skill · 588 installs

From the same set: [coleam00/second-brain-skills](https://affpapa.org/en/nevibecode/by/coleam00/second-brain-skills.md) — 33 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
