Communitygithub.com

Enricrypto/cypher-claude-skills

Remotion(React 기반 비디오 제작) 모범 사례를 제공하는 스킬입니다.

cypher-claude-skills란 무엇인가요?

이 스킬은 Remotion을 활용한 React 기반 비디오 제작에 관한 도메인별 지식을 제공합니다. 새로운 프로젝트를 설정하고, `useCurrentFrame()`과 `interpolate()`를 사용하여 애니메이션을 디자인하며, `<Sequence>`를 통해 콘텐츠의 지연 및 지속 시간을 제어하는 방법을 다룹니다. CSS 전환이나 Tailwind 애니메이션은 렌더링 문제가 있으므로 금지되며, 대신 Remotion 고유의 애니메이션 방식을 사용해야 합니다. 또한, 미디어 자산(이미지, 비디오, 오디오)을 `staticFile()`을 통해 `public/` 폴더에서 참조하는 방법과 `src/Root.tsx`에서 비디오 메타데이터(크기, fps, 길이)를 정의하는 방법을 안내합니다. 이 스킬은 Claude Code와 같은 AI 에이전트와 함께 사용하기에 적합하며, Remotion 프로젝트 관련 질문에 정확한 코드와 모범 사례를 제공합니다. 주요 규칙 파일로는 자막 처리, FFmpeg 활용, 음소거 탐지, 오디오 시각화 등 다양한 주제를 다루는 하위 규칙들이 포함되어 있습니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Enricrypto/cypher-claude-skills/tree/HEAD/skills/remotion-best-practices

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

미리보기

스킬 README에서

문서

사용 시기

Remotion 코드를 다룰 때 도메인 특화 지식을 얻기 위해 이 스킬을 사용하세요.

새 프로젝트 설정

빈 폴더나 기존 Remotion 프로젝트가 없는 작업 공간에서 다음 명령어로 새 프로젝트를 생성합니다:

npx create-video@latest --yes --blank --no-tailwind my-video

my-video를 적절한 프로젝트 이름으로 바꾸세요.

비디오 디자인

useCurrentFrame()과 interpolate()를 사용하여 속성에 애니메이션을 적용하세요. Easing을 사용하여 애니메이션 타이밍을 커스터마이즈할 수 있습니다.

import { useCurrentFrame, Easing } from "remotion";

export const FadeIn = () => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();

  const opacity = interpolate(frame, [0, 2 * fps], [0, 1], {
    extrapolateRight: "clamp",
    extrapolateLeft: "clamp",
    easing: Easing.bezier(0.16, 1, 0.3, 1),
  });

  return <div style={{ opacity }}>Hello World!</div>;
};

CSS 전환이나 애니메이션은 금지됩니다. 올바르게 렌더링되지 않습니다. Tailwind 애니메이션 클래스 이름도 금지됩니다. 올바르게 렌더링되지 않습니다.

프로젝트 루트에 있는 public/ 폴더에 자산을 배치하세요.

public/ 폴더의 파일을 참조하려면 staticFile()을 사용하세요.

<Img> 컴포넌트를 사용하여 이미지를 추가합니다:

import { Img, staticFile } from "remotion";

export const MyComposition = () => {
  return <Img src={staticFile("logo.png")} style={{ width: 100, height: 100 }} />;
};

@remotion/media에서 <Video> 컴포넌트를 사용하여 비디오를 추가합니다:

import { Video } from "@remotion/media";
import { staticFile } from "remotion";

export const MyComposition = () => {
  return <Video src={staticFile("video.mp4")} style={{ opacity: 0.5 }} />;
};

@remotion/media에서 <Audio> 컴포넌트를 사용하여 오디오를 추가합니다:

import { Audio } from "@remotion/media";
import { staticFile } from "remotion";

export const MyComposition = () => {
  return <Audio src={staticFile("audio.mp3")} />;
};

자산은 원격 URL로도 참조할 수 있습니다:

import { Video } from "@remotion/media";

export const MyComposition = () => {
  return <Video src="https://remotion.media/video.mp4" />
};

콘텐츠를 지연시키려면 <Sequence>로 감싸고 from을 사용하세요. 요소의 지속 시간을 제한하려면 <Sequence>의 durationInFrames를 사용하세요. <Sequence>는 기본적으로 절대 채움(absoulte fill)입니다. 인라인 콘텐츠의 경우 layout="none"을 사용하세요.

import { Sequence } from "remotion";

export const Title = () => {
  const frame = useCurrentFrame();
  const { fps } = useVideoConfig();

  const opacity = interpolate(frame, [0, 2 * fps], [0, 1], {
    extrapolateRight: "clamp",
    extrapolateLeft: "clamp",
    easing: Easing.bezier(0.16, 1, 0.3, 1),
  });

  return <div style={{ opacity }}>Title</div>;
};

export const Subtitle = () => {
  return <div>Subtitle</div>;
};

const Main = () => {
  const {fps} = useVideoConfig();

  return (
    <AbsoluteFill>
      <Sequence>
        <Background />
      </Sequence>
      <Sequence from={1 * fps} durationInFrames={2 * fps} layout="none">
        <Title />
      </Sequence>
      <Sequence from={2 * fps} durationInFrames={2 * fps} layout="none">
        <Subtitle />
      </Sequence>
    </AbsoluteFill>
  );
}

비디오의 너비, 높이, fps, 지속 시간은 src/Root.tsx에서 정의됩니다:

import { Composition } from "remotion";
import { MyComposition } from "./MyComposition";

export const RemotionRoot = () => {
  return (
    <Composition
      id="MyComposition"
      component={MyComposition}
      durationInFrames={100}
      fps={30}
      width={1080}
      height={1080}
    />
  );
};

메타데이터는 동적으로 계산할 수도 있습니다:

import { Composition, CalculateMetadataFunction } from "remotion";
import { MyComposition, MyCompositionProps } from "./MyComposition";

const calculateMetadata: CalculateMetadataFunction<
  MyCompositionProps
> = async ({ props, abortSignal }) => {
  const data = await fetch(`https://api.example.com/video/${props.videoId}`, {
    signal: abortSignal,
  }).then((res) => res.json());

  return {
    durationInFrames: Math.ceil(data.duration * 30),
    props: {
      ...props,
      videoUrl: data.url,
    },
    width: 1080,
    height: 1080,
  };
};

export const RemotionRoot = () => {
  return (
    <Composition
      id="MyComposition"
      component={MyComposition}
      fps={30}
      width={1080}
      height={1080}
      defaultProps={{ videoId: "abc123" }}
      calculateMetadata={calculateMetadata}
    />
  );
};

미리보기 시작

Remotion Studio를 시작하여 비디오를 미리 봅니다:

npx remotion studio

선택 사항: 단일 프레임 렌더링 확인

CLI를 사용하여 단일 프레임을 렌더링해 레이아웃, 색상 또는 타이밍을 sanity-check 할 수 있습니다. 간단한 수정, 순수 리팩터링, 또는 Studio나 이전 렌더링에서 충분한 확신이 있을 때는 건너뛰세요.

npx remotion still [composition-id] --scale=0.25 --frame=30

30fps에서 --frame=30은 1초 지점입니다 (--frame은 0부터 시작).

자막 (Captions)

자막 또는 서브타이틀을 다룰 때는 ./rules/subtitles.md 파일을 로드하여 더 많은 정보를 확인하세요.

FFmpeg 사용

비디오 자르기 또는 무음 감지와 같은 일부 비디오 작업에는 FFmpeg를 사용해야 합니다. ./rules/ffmpeg.md 파일을 로드하여 더 많은 정보를 확인하세요.

무음 감지

비디오 또는 오디오 파일에서 무음 구간을 감지하고 잘라내야 할 때는 ./rules/silence-detection.md 파일을 로드하세요.

오디오 시각화

오디오를 시각화(스펙트럼 막대, 파형, 베이스 반응 효과)해야 할 때는 ./rules/audio-visualization.md 파일을 로드하여 더 많은 정보를 확인하세요.

사운드 효과

사운드 효과를 사용해야 할 때는 ./rules/sfx.md 파일을 로드하여 더 많은 정보를 확인하세요.

3D 콘텐츠

Three.js 및 React Three Fiber를 사용하여 Remotion에서 3D 콘텐츠를 보려면 rules/3d.md를 참조하세요.

고급 오디오

트리밍, 볼륨, 속도, 피치와 같은 고급 오디오 기능은 rules/audio.md를 참조하세요.

동적 지속 시간, 크기 및 데이터

컴포지션 지속 시간, 크기 및 props를 동적으로 설정하려면 rules/calculate-metadata.md를 참조하세요.

고급 컴포지션

스틸, 폴더, 기본 props 및 컴포지션 중첩 방식에 대해서는 rules/compositions.md를 참조하세요.

Google Fonts

Remotion에서 글꼴을 로드하는 권장 방법입니다. Google Fonts 로드 방법은 rules/google-fonts.md를 참조하세요.

로컬 폰트

로컬 폰트 로드 방법은 rules/local-fonts.md를 참조하세요.

오디오 길이 가져오기

Mediabunny를 사용하여 오디오 파일의 길이(초)를 가져오는 방법은 rules/get-audio-duration.md를 참조하세요.

비디오 크기 가져오기

Mediabunny를 사용하여 비디오 파일의 너비와 높이를 가져오는 방법은 rules/get-video-dimensions.md를 참조하세요.

비디오 길이 가져오기

Mediabunny를 사용하여 비디오 파일의 길이(초)를 가져오는 방법은 rules/get-video-duration.md를 참조하세요.

GIF

Remotion의 타임라인과 동기화된 GIF를 표시하는 방법은 rules/gifs.md를 참조하세요.

고급 이미지

이미지 크기 및 위치 조정, 동적 이미지 경로, 이미지 크기 가져오기는 rules/images.md를 참조하세요.

라이트 릭 (Light leaks)

@remotion/light-leaks를 사용한 라이트 릭 오버레이 효과는 rules/light-leaks.md를 참조하세요.

Lottie 애니메이션

Remotion에 Lottie 애니메이션을 임베딩하는 방법은 rules/lottie.md를 참조하세요.

캔버스 내 HTML

2D 또는 WebGL 효과를 위해 <HtmlInCanvas>를 통해 <canvas>에 HTML을 렌더링해야 한다면 rules/html-in-canvas.md를 참조하세요.

DOM 노드 측정

Remotion에서 DOM 요소 크기를 측정하는 방법은 rules/measuring-dom-nodes.md를 참조하세요.

텍스트 측정

텍스트 크기 측정, 컨테이너에 텍스트 맞추기, 오버플로 확인은 rules/measuring-text.md를 참조하세요.

고급 시퀀싱

지연, 트리밍, 항목 지속 시간 제한 등 더 많은 시퀀싱 패턴은 rules/sequencing.md를 참조하세요.

TailwindCSS

Remotion에서 TailwindCSS를 사용하는 방법은 rules/tailwind.md를 참조하세요.

텍스트 애니메이션

타이포그래피 및 텍스트 애니메이션 패턴은 rules/text-animations.md를 참조하세요.

고급 타이밍

interpolate와 베지어 이징, 스프링을 활용한 고급 타이밍은 rules/timing.md를 참조하세요.

전환 (Transitions)

장면 전환 패턴은 rules/transitions.md를 참조하세요.

투명 비디오

투명도를 가진 비디오를 렌더링하는 방법은 rules/transparent-videos.md를 참조하세요.

트리밍 (Trimming)

애니메이션의 시작이나 끝을 자르는 트리밍 패턴은 rules/trimming.md를 참조하세요.

고급 비디오

비디오 임베딩에 대한 고급 지식(트리밍, 볼륨, 속도, 반복, 피치)은 rules/videos.md를 참조하세요.

파라미터화된 비디오

Zod 스키마를 추가하여 컴포지션을 파라미터화하는 방법은 rules/parameters.md를 참조하세요.

지도

간단한 비행 경로가 있는 지도는 정적 지도 이미지를 사용하는 것을 고려하세요. 복잡한 애니메이션 경로 또는 비행 경로가 있는 지도의 경우 지도 규칙을 로드하세요: rules/maplibre.md

음성 해설 (Voiceover)

ElevenLabs TTS를 사용하여 Remotion 컴포지션에 AI 생성 음성 해설을 추가하는 방법은 rules/voiceover.md를 참조하세요.

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

관련 스킬