compress_video
Shrink video files to meet upload size limits using target file sizes, presets, or CRF quality levels without altering the original.
Instructions
Compress video files to fit upload limits (such as GitHub PRs under 10MB or Discord under 25MB) using target file sizes or CRF quality levels. Does not modify the original file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| crf | No | Quality value between 18 (higher quality) and 45 (smaller file). Overrides preset. | |
| preset | No | Preset when targetSizeMB is not set: 'github_pr', 'discord', 'email', 'balanced', or 'high_quality'. Default: 'balanced'. | balanced |
| maxWidth | No | Maximum video width in pixels, such as 1280 for 720p. Keeps aspect ratio. | |
| inputPath | Yes | Path to the source video file (e.g. './recordings/demo.mov') | |
| outputPath | Yes | Destination path for the compressed MP4 file (e.g. './recordings/demo_compressed.mp4') | |
| targetSizeMB | No | Target output size in megabytes, such as 9.5 for GitHub or 24 for Discord. Computes bitrates from duration. | |
| hardwareAcceleration | No | Use hardware-accelerated video encoding (VideoToolbox, NVENC, QSV, etc.) when available. Default: true. |