π₯ Make videos programmatically with React
skills.md and ffmpeg.md added
Ayushman51be49ebe76b
diff --git a/packages/skills/skills/remotion/SKILL.md b/packages/skills/skills/remotion/SKILL.mdindex 78848d0a9d..2c6af98f48 100644--- a/packages/skills/skills/remotion/SKILL.md+++ b/packages/skills/skills/remotion/SKILL.md@@ -23,6 +23,7 @@ Read individual rule files for detailed explanations and code examples:- [rules/compositions.md](rules/compositions.md) - Defining compositions, stills, folders, default props and dynamic metadata- [rules/display-captions.md](rules/display-captions.md) - Displaying captions in Remotion with TikTok-style pages and word highlighting- [rules/extract-frames.md](rules/extract-frames.md) - Extract frames from videos at specific timestamps using Mediabunny+- [rules/ffmpeg.md](rules/ffmpeg.md) - Using FFmpeg and FFprobe in Remotion - installation, trimming, re-encoding- [rules/fonts.md](rules/fonts.md) - Loading Google Fonts and local fonts in Remotion- [rules/get-audio-duration.md](rules/get-audio-duration.md) - Getting the duration of an audio file in seconds with Mediabunny- [rules/get-video-dimensions.md](rules/get-video-dimensions.md) - Getting the width and height of a video file with Mediabunnydiff --git a/packages/skills/skills/remotion/rules/ffmpeg.md b/packages/skills/skills/remotion/rules/ffmpeg.mdnew file mode 100644index 0000000000..c8bda43610--- /dev/null+++ b/packages/skills/skills/remotion/rules/ffmpeg.md@@ -0,0 +1,54 @@+---+name: ffmpeg+description: Using FFmpeg and FFprobe in Remotion+metadata:+ tags: ffmpeg, ffprobe, video, audio, trimming, re-encoding+---++## Installation++You do **not** need to install FFmpeg manually. Since Remotion v4.0, FFmpeg is bundled with Remotion.++β **Don't** instruct users to install FFmpeg or use the system `ffmpeg` command.+β **Do** use the `bunx remotion ffmpeg` or `bunx remotion ffprobe` commands which use the bundled binaries (v7.1 release line).++Supported codecs: H.264, H.265, VP8, VP9, and ProRes.++## Usage++Run FFmpeg and FFprobe commands using the Remotion CLI:++```bash+bunx remotion ffmpeg -i input.mp4 output.mp3+bunx remotion ffprobe input.mp4+```++## Trimming Videos++### Avoid Stream Copy (`-c copy`) for Exact Cuts++β **Avoid** using `-c copy` when trimming videos unless you are sure the cut points are on keyframes.+It causes **frozen frames** at the start of the video if the cut is not on a keyframe.++```bash+# This often causes frozen frames at the beginning!+bunx remotion ffmpeg -ss 00:00:05 -i input.mp4 -to 00:00:10 -c copy output.mp4+```++### Preferred: Re-encode (Safe Default)++β **Recommend** re-encoding for accurate trimming without frozen frames.++```bash+# Re-encodes from the exact frame+bunx remotion ffmpeg -ss 00:00:05 -i input.mp4 -to 00:00:10 -c:v libx264 -c:a aac output.mp4+```++### Advanced: Keyframe-based Cutting++Only use `-c copy` if you are using `-f segment` or if the user explicitly understands the keyframe limitations.++```bash+# Split at keyframes (no frozen frames, but cut points depend on GOP structure)+bunx remotion ffmpeg -i input.mp4 -f segment -reset_timestamps 1 -segment_time 10 -c copy out%03d.mp4+```