# import-srt-captions

import-srt-captions — a Claude Code rule for importing .srt subtitle files into Remotion video projects. Uses parseSrt() from @remotion/captions to extract subtitles and integrate them into components.

- 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/import-srt-captions.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/import-srt-captions

## What it does

The rule demonstrates how to load an .srt file from the `public` folder or a remote URL, parse it with `parseSrt()`, and work with Caption objects. It uses `staticFile()` for local files and `fetch()` with `useDelayRender()` to ensure the component waits for parsing to complete. The example includes error handling via `cancelRender()`.

Before using it, install `@remotion/captions` with the appropriate command for your package manager (npm, yarn, pnpm, or bun). Once parsed, Caption objects work with all utilities from `@remotion/captions`.

## Install

### Claude Code (native platform)

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

### GitHub Copilot

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

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/import-srt-captions.md`

### Cline

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

## When to use it
- Load and parse an SRT file within a Remotion React component
- Extract timecodes and subtitle text from an existing file
- Sync imported subtitles with video composition
- Handle async subtitle loading before rendering begins

## Example prompts
- Parse SRT and use subtitles in your Remotion video composition
- Fetch `subtitles.srt` from `public` and retrieve the Caption array
- Import remote subtitles via URL instead of a local file

## Similar
- [remotion-captions](https://affpapa.org/en/nevibecode/skills/remotion-dev-remotion-captions.md) — skill · 373700 installs
- [captions-media-accessibility](https://affpapa.org/en/nevibecode/skills/captions-media-accessibility.md) — skill · 195 installs
- [srt](https://affpapa.org/en/nevibecode/skills/srt.md) — skill · ★ 40 repo stars
- [captions](https://affpapa.org/en/nevibecode/skills/appariciojunior-captions.md) — skill · ★ 470 repo stars
- [scenario-caption-studio](https://affpapa.org/en/nevibecode/skills/scenario-caption-studio.md) — skill · 861 installs
- [ffmpeg-captions-subtitles](https://affpapa.org/en/nevibecode/skills/ffmpeg-captions-subtitles.md) — skill · 634 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
