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 `npx remotion ffmpeg` and `npx remotion ffprobe`:1112```bash13npx remotion ffmpeg -i input.mp4 output.mp314npx remotion ffprobe input.mp415```1617### Trimming videos1819You have 2 options for trimming videos:20211. **Preferred**: Use the `trimBefore` and `trimAfter` props of the `<Video>` component. This is non-destructive, requires no re-encoding, and you can change the trim at any time.2223```tsx24import {Video} from '@remotion/media';2526<Video src={staticFile('video.mp4')} trimBefore={5 * fps} trimAfter={10 * fps} />;27```28292. Use the FFmpeg command line. You MUST re-encode the video to avoid frozen frames at the start of the video. Only use this if you need a standalone trimmed file (e.g. for upload or external use).3031```bash32# Re-encodes from the exact frame33npx remotion ffmpeg -ss 00:00:05 -i public/input.mp4 -to 00:00:10 -c:v libx264 -c:a aac public/output.mp434```35