calculate_aspect_ratio
Simplify pixel dimensions into aspect ratios, align frames to codec block sizes, and generate center-crop or letterbox/pad plans for target ratios.
Instructions
Simplify pixel dimensions to their aspect ratio, align to codec macroblocks, and optionally compute centre-crop and letterbox/pad plans for a target ratio.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | Yes | Frame width in pixels. | |
| height | Yes | Frame height in pixels. | |
| blockSize | No | Optional codec block alignment (default 2). | |
| targetRatioH | No | Optional target aspect ratio height term (e.g. 16). | |
| targetRatioW | No | Optional target aspect ratio width term (e.g. 9). |