Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply best practices for creating programmatic videos with Remotion and React.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/ffmpeg.md
1---2name: ffmpeg3description: Using FFmpeg and FFprobe in Remotion4metadata:5tags: ffmpeg, ffprobe, video, trimming6---78## FFmpeg in Remotion910`ffmpeg` and `ffprobe` do not need to be installed. They are available via the `bunx remotion ffmpeg` and `bunx remotion ffprobe`:1112```bash13bunx remotion ffmpeg -i input.mp4 output.mp314bunx remotion ffprobe input.mp415```1617### Trimming videos1819You have 2 options for trimming videos:20211. Use the FFmpeg command line. You MUST re-encode the video to avoid frozen frames at the start of the video.2223```bash24# Re-encodes from the exact frame25bunx remotion ffmpeg -ss 00:00:05 -i public/input.mp4 -to 00:00:10 -c:v libx264 -c:a aac public/output.mp426```27282. Use the `trimBefore` and `trimAfter` props of the `<Video>` component. The benefit is that this is non-destructive and you can change the trim at any time.2930```tsx31import { Video } from "@remotion/media";3233<Video34src={staticFile("video.mp4")}35trimBefore={5 * fps}36trimAfter={10 * fps}37/>;38```39