Communitygithub.com

IGNOVA-SYSTEMS-INTEGRATION/KONTRX

Remotion(React/TypeScript 기반, MP4로 렌더링)으로 비디오를 프로그래매틱하게 제작하기 위한 모범 사례 및 도메인 지식입니다. Remotion 코드를 작성하거나 편집할 때, 그리고 Remotion API에 접근하기 전에 참조하세요.

KONTRX란 무엇인가요?

이 스킬은 Remotion을 사용하여 프로그래매틱하게 비디오를 제작하는 데 필요한 모범 사례와 도메인 지식을 제공합니다. Remotion은 React와 TypeScript를 사용하여 비디오를 만들고 MP4로 렌더링하는 라이브러리입니다. 프로젝트 스캐폴딩, 애니메이션(interpolate, spring), 시퀀싱, 자막, 오디오, GIF, Lottie, 3D 콘텐츠, 차트, 시각 효과, 동적 지속 시간(calculateMetadata), 렌더링 등 비디오 제작의 모든 측면을 다룹니다. 스킬은 새로운 프로젝트 설정, 비디오 디자인 원칙(프레임 기반 애니메이션, CSS 변환 사용), 자산 관리(public 폴더, staticFile, Img, Video, Audio 컴포넌트), 시퀀싱(Sequence), 동적 메타데이터, 캡션, FFmpeg 활용, 오디오 시각화, 사운드 효과, 시각 효과, 3D, 고급 오디오 등 다양한 주제에 대한 상세한 지침을 포함합니다. 또한 Google Fonts, 로컬 폰트, GIF, Lottie, TailwindCSS, 텍스트 애니메이션, 전환, 투명 비디오, 트리밍, 파라미터화된 비디오, 지도, 음성 해설 등에 대한 규칙 파일을 참조합니다. 이 스킬은 개발자와 AI 에이전트가 Remotion의 최신 API와 모범 사례를 따르면서 효율적으로 비디오를 제작할 수 있도록 돕습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/IGNOVA-SYSTEMS-INTEGRATION/KONTRX/tree/HEAD/AGENT/skills/remotion

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

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

미리보기

스킬 README에서

문서

사용 시기

이 스킬은 Remotion 코드를 다룰 때 도메인별 지식을 얻기 위해 사용합니다.

새 프로젝트 설정

빈 폴더나 기존 Remotion 프로젝트가 없는 작업 공간에서 다음 명령어로 프로젝트를 스캐폴딩합니다.

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

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

비디오 디자인

시각적 장면, 레이아웃, 프로모션, 모션 그래픽 또는 텍스트가 많은 비디오를 디자인하기 전에 rules/video-layout.md를 로드하여 비디오 우선 레이아웃 및 텍스트 크기 조정 지침을 확인하세요.

useCurrentFrame()과 interpolate()를 사용하여 속성을 애니메이션합니다. 물리 기반 모션이 명시적으로 필요한 경우가 아니라면 spring()보다 interpolate()를 선호하세요. Easing.bezier()를 사용하여 점프 또는 오버슈팅 모션을 포함한 타이밍을 사용자 정의하세요.

Remotion Studio에서 편집 가능해야 하는 애니메이션의 경우 interpolate() 호출을 style prop에 인라인으로 유지하고 transform 문자열을 구성하는 대신 개별 CSS 변환 속성(scale, translate, rotate)을 사용하세요.

import { useCurrentFrame, Easing, interpolate, useVideoConfig } 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>;
};

다음 방식 선호:

style={{
  scale: interpolate(frame, [0, 100], [0, 1]),
  translate: interpolate(frame, [0, 100], ["0px 0px", "100px 100px"]),
  rotate: interpolate(frame, [0, 100], ["20deg", "90deg"]),
}}

다음 방식보다:

const scale = interpolate(frame, [0, 100], [0, 1]);

style={{
  transform: `scale(${scale})`,
}}

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

에셋은 프로젝트 루트의 public/ 폴더에 배치하세요.

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

<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>는 기본적으로 절대 채움입니다. 인라인 콘텐츠의 경우 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를 사용하여 단일 프레임을 렌더링하여 레이아웃, 색상 또는 타이밍을 확인할 수 있습니다. 사소한 편집, 순수 리팩터링 또는 Studio나 이전 렌더링에서 충분히 확신이 있는 경우 건너뛰세요.

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

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

캡션

캡션이나 자막을 다룰 때는 ./rules/subtitles.md 파일을 로드하여 자세한 정보를 확인하세요.

FFmpeg 사용

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

무음 감지

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

오디오 시각화

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

사운드 효과

사운드 효과를 사용해야 하는 경우 ./rules/sfx.md 파일을 로드하여 자세한 정보를 확인하세요.

시각 및 픽셀 효과

시각 효과를 만들 때는 다음 순서를 선호합니다: 1. 일반 Remotion/HTML/CSS/SVG/필터/블렌드/마스크 애니메이션, 2. rules/effects.md에 나열된 효과(<HtmlInCanvas>를 통해 렌더링된 HTML 포함), 3. 재사용 가능하거나 프로젝트별 효과가 필요한 경우 rules/effects.md를 통한 사용자 정의 createEffect(), 4. 효과가 맞지 않는 경우에만 rules/html-in-canvas.md를 통한 사용자 정의 <HtmlInCanvas onPaint>.

라이트 릭 오버레이의 경우 rules/light-leaks.md를 참조하세요. 문서: https://www.remotion.dev/docs/effects

사용 가능한 효과: brightness(), contrast(), colorKey(), duotone(), grayscale(), hue(), invert(), saturation(), tint(), linearGradient(), linearGradientTint(), thermalVision(), blur(), linearProgressiveBlur(), radialProgressiveBlur(), zoomBlur(), dropShadow(), glow(), lightTrail(), evolve(), venetianBlinds(), mirror(), scale(), uvTranslate(), xyTranslate(), barrelDistortion(), chromaticAberration(), fisheye(), cornerPin(), wave(), burlap(), emboss(), dotGrid(), halftone(), noise(), noiseDisplacement(), paper(), pattern(), pixelate(), pixelDissolve(), scanlines(), speckle(), shine(), shrinkwrap(), vignette(), contourLines(), checkerboard(), halftoneLinearGradient(), gridlines(), whiteNoise(), tvSignalOff(), lines(), rings(), waves(), zigzag(), lightLeak(), starburst().

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를 참조하세요.

Lottie 애니메이션

Remotion에 Lottie 애니메이션을 포함하는 방법은 rules/lottie.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를 참조하세요.

전환

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

투명 비디오

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

트리밍

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

고급 비디오

비디오 포함에 대한 고급 지식(트리밍, 볼륨, 속도, 루핑, 피치)은 rules/videos.md를 참조하세요.

파라미터화된 비디오

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

지도

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

음성 해설

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

관련 스킬