Node / Video Ffmpeg · guide
Geometry: rotate & crop
Current Apexify.js 6.0.0 documentation for Geometry: rotate & crop.
rotate
What it does: Applies transpose for 90° steps and/or hflip/vflip.
Options
| Field | Effect |
|---|---|
angle | 90 → transpose=1 (clockwise-like mapping used in code); 180 → double transpose; 270 → transpose=2. |
flip | horizontal — mirror left/right; vertical — flip upside down; both — apply both. |
outputPath | ✓ |
You can combine angle and flip.
Example — upright phone video
SOURCEtypescript
typescript
crop
What it does: crop=w:h:x:y — keeps a width×height rectangle whose top-left is (x, y) in pixels.
Options
| Field | Meaning |
|---|---|
x, y | Origin of crop window (pixels from top-left). |
width, height | Size of output (pixels). |
outputPath | ✓ |
Values outside frame bounds will error or clamp depending on FFmpeg — prefer validating against getInfo first.
Example — 16:9 centre crop from 4K
SOURCEtypescript
typescript