# can-decode

Checks whether the browser can decode a video or audio stream before attempting playback using Mediabunny.

- 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/can-decode.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/can-decode

## What it does

The rule guides the agent to inject a ready-made `canDecode` helper in TypeScript. It constructs a Mediabunny `Input` instance, verifies container parsing, and tests decodability across the primary video and audio tracks.

It handles both network URLs with `UrlSource` and client file inputs via `BlobSource`. Because the snippet relies directly on classes like `Input` and `ALL_FORMATS`, the project requires the `mediabunny` package installed to compile.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/can-decode.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/can-decode.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

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

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/can-decode.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/can-decode.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/can-decode.md

## When to use it
- verify browser video codec support before playback
- validate decodability for remote media URLs
- check user-uploaded video blobs prior to processing

## Example prompts
- Write a helper to check if a video URL is playable in the browser using mediabunny
- Add validation for uploaded video blobs with BlobSource
- Check whether this browser can decode the media track before playback

## Similar
- [remotion-multimedia](https://affpapa.org/en/nevibecode/skills/remotion-multimedia.md) — skill · 3 installs
- [playwright-recording](https://affpapa.org/en/nevibecode/skills/playwright-recording.md) — skill · 2000 installs
- [reference-decode](https://affpapa.org/en/nevibecode/skills/reference-decode.md) — skill · 1000 installs
- [zoom-video-sdk-web](https://affpapa.org/en/nevibecode/skills/zoom-video-sdk-web.md) — skill · ★ 8052 repo stars
- [chrome-extension-development](https://affpapa.org/en/nevibecode/skills/chrome-extension-development.md) — skill · 3000 installs
- [proofreader-api](https://affpapa.org/en/nevibecode/skills/proofreader-api.md) — skill · 513 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
