Methodology, Formulas & Parameter Reference
Converting a horizontal 16:9 master into a vertical 9:16 deliverable requires either cropping away horizontal pixels (pan-and-scan) or scaling the source down and padding the remaining vertical space with letterbox bars or a blurred background plate. In FFmpeg, both operations use Cartesian pixel coordinates anchored at the top-left corner of the frame, where (0, 0) represents the first column and first row of pixels.
The crop filter accepts four primary arguments: crop=out_w:out_h:x:y. When converting a 1920x1080 source to a full-height 9:16 frame without vertical scaling, the output height remains 1080 and the output width is computed as \(\text{out\_w} = \text{round}(1080 \times \frac{9}{16}) = 608\) pixels (rounded to the nearest even integer). The horizontal center offset is then \(x = \frac{1920 - 608}{2} = 656\), and \(y = 0\), yielding crop=608:1080:656:0,scale=1080:1920:flags=lanczos if a full 1080x1920 delivery raster is required.
Conversely, the pad filter expands the canvas around a scaled image using pad=canvas_w:canvas_h:x:y:color. To fit a 1920x1080 clip inside a 1080x1920 vertical canvas without cropping, the video is first scaled to 1080 pixels wide by \(\text{round}(1080 \times \frac{9}{16}) = 608\) pixels high. It is then placed onto the 1080x1920 canvas at \(x = 0\) and \(y = \frac{1920 - 608}{2} = 656\). Every coordinate generated by this calculator is forced to an even integer (divisible by 2) because 4:2:0 chroma subsampling shares one UV chroma sample across each \(2 \times 2\) luma pixel block; odd crop or pad offsets cause chroma shift or encoder initialization errors.
| Source Raster | Target Format | Conversion Mode | Exact FFmpeg Filterchain (-vf) |
|---|---|---|---|
1920x1080 (16:9) |
9:16 Center Crop | Crop + Scale | crop=608:1080:656:0,scale=1080:1920 |
3840x2160 (16:9) |
9:16 Center Crop | Native Crop | crop=1216:2160:1312:0,scale=1080:1920 |
1920x1080 (16:9) |
1:1 Square | Center Crop | crop=1080:1080:420:0 |
1920x1080 (16:9) |
4:5 Portrait | Crop + Scale | crop=864:1080:528:0,scale=1080:1350 |
1920x1080 (16:9) |
9:16 Letterbox | Scale + Pad | scale=1080:608,pad=1080:1920:0:656:black |
Production Workflow Verification & Quality Control
Before committing a full batch transcode or publishing a final master, verify the generated parameters against a five-second test slice of your source timeline. In post-production pipelines, container metadata headers, variable frame rate (VFR) timebases from mobile or screen-capture recordings, and non-square pixel aspect ratios can alter how downstream players interpret stream flags. Running every calculation and file conversion locally in browser memory ensures your production assets remain private while providing deterministic numbers you can paste directly into terminal automation scripts, NLE export presets, or camera prep checklists.