Communitygithub.com

remotion-captions — Sous-titres animés pour vidéos

Ajoutez des sous-titres animés et des légendes aux vidéos Remotion à partir de fichiers .SRT. Effets mot par mot façon TikTok, effets karaoké, et plus encore.

Qu'est-ce que remotion-captions — Sous-titres animés pour vidéos ?

Cette compétence permet d'ajouter facilement des sous-titres animés aux projets Remotion à l'aide du package `remotion-subtitles`. Elle prend en charge le chargement de fichiers .SRT, le style CSS personnalisé, et met en œuvre des effets de surbrillance mot par mot inspirés de TikTok, y compris des animations d'échelle et des changements de couleur sur les mots actifs. Le résumé inclut une explication détaillée (100 à 150 mots) : les développeurs peuvent utiliser le composant `SubtitleSequence` pour afficher des sous-titres formatés, ou construire des composants React personnalisés avec `useCurrentFrame` et `interpolate` pour un contrôle fin. La compétence est destinée aux utilisateurs de Remotion, principalement sur les plateformes Node.js/React, et couvre l'installation, l'utilisation de base, le style, les surbrillances mot par mot, et les définitions manuelles de sous-titres. Les bonnes pratiques incluent le positionnement en bas, le contraste élevé, les grandes polices, les phrases courtes et une marge de synchronisation. Le dépôt source est github.com/ahgsql/remotion-subtitles.

Compatible avec~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ever-just/agentskills/tree/HEAD/skills/remotion-captions

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Remotion Captions — Sous-titres animés pour vidéos

Ajoutez des sous-titres animés et des légendes aux vidéos Remotion à partir de fichiers .SRT. Effets mot par mot façon TikTok, effets karaoké, et plus encore.

Vue d'ensemble

  • Dépôt : github.com/ahgsql/remotion-subtitles
  • Langage : TypeScript / React
  • Licence : Open Source
  • Installation : npm install remotion-subtitles
  • Prérequis : Projet Remotion

Configuration

npm install remotion-subtitles

Utilisation de base

Depuis un fichier SRT

import { useSubtitles, SubtitleSequence } from "remotion-subtitles";

export const CaptionedVideo: React.FC = () => {
  const subtitles = useSubtitles("./subtitles.srt");

  return (
    <AbsoluteFill>
      <Video src={staticFile("video.mp4")} />
      <SubtitleSequence subtitles={subtitles} />
    </AbsoluteFill>
  );
};

Format SRT

1
00:00:00,000 --> 00:00:02,500
Bienvenue sur Custom Agents

2
00:00:02,500 --> 00:00:05,000
La plateforme email alimentée par l'IA

3
00:00:05,000 --> 00:00:08,000
qui gère votre boîte de réception automatiquement

Styliser les sous-titres

<SubtitleSequence
  subtitles={subtitles}
  style={{
    position: "absolute",
    bottom: 80,
    left: 0,
    right: 0,
    textAlign: "center",
    fontSize: 42,
    fontWeight: "bold",
    color: "white",
    textShadow: "2px 2px 8px rgba(0,0,0,0.8)",
    fontFamily: "Inter, sans-serif",
  }}
/>

Surbrillance mot par mot (style TikTok)

import { useCurrentFrame, interpolate } from "remotion";

export const WordHighlightCaption: React.FC<{
  words: { text: string; startFrame: number; endFrame: number }[];
}> = ({ words }) => {
  const frame = useCurrentFrame();

  return (
    <div style={{
      position: "absolute",
      bottom: 100,
      width: "100%",
      textAlign: "center",
      display: "flex",
      justifyContent: "center",
      gap: 8,
      flexWrap: "wrap",
      padding: "0 60px",
    }}>
      {words.map((word, i) => {
        const isActive = frame >= word.startFrame && frame <= word.endFrame;
        const scale = isActive
          ? interpolate(frame, [word.startFrame, word.startFrame + 3], [1, 1.15], { extrapolateRight: "clamp" })
          : 1;

        return (
          <span
            key={i}
            style={{
              fontSize: 48,
              fontWeight: 800,
              color: isActive ? "#FFD700" : "white",
              textShadow: isActive
                ? "0 0 20px rgba(255,215,0,0.5)"
                : "2px 2px 4px rgba(0,0,0,0.8)",
              transform: `scale(${scale})`,
              transition: "color 0.1s",
              display: "inline-block",
            }}
          >
            {word.text}
          </span>
        );
      })}
    </div>
  );
};

Synchronisation manuelle des sous-titres

Si vous n'avez pas de fichier SRT, définissez les sous-titres manuellement :

const captions = [
  { text: "Bienvenue sur Custom Agents", startFrame: 0, endFrame: 75 },
  { text: "Automatisation email par IA", startFrame: 80, endFrame: 150 },
  { text: "Créez des agents en quelques minutes", startFrame: 155, endFrame: 240 },
];

export const ManualCaptions: React.FC = () => {
  const frame = useCurrentFrame();

  const current = captions.find(
    (c) => frame >= c.startFrame && frame <= c.endFrame
  );

  if (!current) return null;

  const progress = interpolate(
    frame,
    [current.startFrame, current.startFrame + 10],
    [0, 1],
    { extrapolateRight: "clamp" }
  );

  return (
    <div style={{
      position: "absolute",
      bottom: 80,
      width: "100%",
      textAlign: "center",
      opacity: progress,
      transform: `translateY(${(1 - progress) * 10}px)`,
    }}>
      <span style={{
        fontSize: 44,
        fontWeight: 700,
        color: "white",
        backgroundColor: "rgba(0,0,0,0.6)",
        padding: "8px 24px",
        borderRadius: 8,
      }}>
        {current.text}
      </span>
    </div>
  );
};

Bonnes pratiques

  1. Position en bas — Le placement standard des sous-titres est en bas au centre
  2. Utilisez le contraste — Texte blanc avec ombre foncée ou fond semi-transparent
  3. Police large — 40-50 px minimum pour la lisibilité dans une vidéo
  4. Phrases courtes — Maximum 2 lignes, 6-8 mots par sous-titre
  5. Marge de synchronisation — Commencez les sous-titres 2-3 images avant l'audio
  6. Animation d'entrée — Apparition/glissement subtil, pas d'animation à la sortie
  7. Gras — Poids de police 700+ pour la lisibilité vidéo

Source

  • remotion-subtitles : github.com/ahgsql/remotion-subtitles
  • Modèle Remotion Audiogram : github.com/remotion-dev/template-audiogram

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

ever-just/agentskills

> Declarative animations for React. Springs, gestures, layout animations, and page transitions. GPU-accelerated, production-ready.

ever-just/agentskills

> Create animated logos, icons, and micro-interactions as lightweight Lottie JSON files. No After Effects needed — build animations entirely in code.

ever-just/agentskills

> A TypeScript library using generators to program animations with a real-time editor. Ideal for explainer videos, code walkthroughs, and educational content.

ever-just/agentskills

> Create videos programmatically using React components. The most mature framework for code-driven video production.

ever-just/agentskills

> Copy-paste video components for Remotion. Intros, text effects, transitions, and full scene templates. Like shadcn/ui but for video.

ever-just/agentskills

Extract actionable intelligence from video content across YouTube, Vimeo, and company websites. Video reveals what text sources cannot: facility scale, team composition, product demonstrations, signage, event attendance, and operational reality.

ever-just/agentskills

Optimize and embed an existing video as a fast, crisp, autoplaying hero/background/loop on a website. Use when adding or replacing a video on a marketing site and it is too heavy, will not autoplay (especially on mobile/Safari), shows a codec error, or looks soft — to transcode it to web-safe H.264 with the right pixel format, faststart, retina-aware sizing, and a poster frame, then embed and verify it actually plays. This is optimization + embedding of footage you already have, not creating/animating a video (for that use remotion/moviepy/motion-canvas). Use when the user says "add this video to the site", "the hero video is too big / won't play / isn't crisp", "replace the homepage video", or "make this loop on the landing page".

ever-just/agentskills

Full conversion audit for any homepage or landing page. Use when someone asks to "review my homepage," "audit my landing page," "why isn't my page converting," "check my website," or wants feedback on their marketing page. Requires URL or screenshot before proceeding.

ever-just/agentskills

Automatically fetch YouTube video transcripts, generate structured summaries, and send full transcripts to messaging platforms. Detects YouTube URLs and provides metadata, key insights, and downloadable transcripts.

Skills associés