Skip to main content
rule CX Codex

import-srt-captions — Claude Code rule: parse SRT into Remotion

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.

no license ★ 849 updated 2026-01-24

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/import-srt-captions.md
Open on GitHub

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

What it helps with

  • 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 for the agent

  • 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

How to install import-srt-captions

Manually: put the files in place

.claude/rules/import-srt-captions.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about import-srt-captions

How do I install the import-srt-captions rule in Claude Code?

Copy the file to .claude/rules/import-srt-captions.md in your project. Claude Code will load it automatically on the next start.

What does the import-srt-captions rule do?

It provides a pattern for parsing .srt files using parseSrt() from @remotion/captions. The example shows local file loading via staticFile(), error handling, and how to use parsed captions in a component.

What dependencies are required?

You need the @remotion/captions package. Install it with npx remotion add @remotion/captions (npm) or the equivalent command for your package manager (yarn, pnpm, bun).

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set33

The whole set →

Project sponsors

Companies that keep this analytics open