FFmpeg & Automation Runs Locally in Your Browser

Interactive Crop & Pad Coordinate Calculator

Compute exact pixel coordinates and preview visual framing for FFmpeg crop and pad filtergraphs when converting between 16:9, 9:16, 4:5, and 1:1 formats.

Interactive Workspace: Visual Crop & Pad 100% Local Browser Processing (Zero Server Upload)
Crop Window: 608x1080 at (656, 0)
Even-aligned coordinates ready.

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.

Common 16:9 Source to Social Deliverable Coordinate Mappings
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.

Frequently Asked Questions

Why does the calculator round 607.5 pixels to 608 instead of 607?

Standard distribution codecs use YUV 4:2:0 chroma subsampling, where colour planes have half the horizontal and vertical resolution of the luma plane. Odd width, height, X, or Y values split a 2x2 pixel block and cause libx264/libx265 to fail with a width/height not divisible by 2 error.

Should I crop a 1080p source to 608x1080 and leave it, or upscale it to 1080x1920?

Upload platforms such as TikTok, Reels, and YouTube Shorts allocate higher bitrate tiers to 1080x1920 uploads than to 608x1080 files. Appending scale=1080:1920:flags=lanczos preserves edge sharpness prior to platform recompression.

How does the blurred background pad mode work in a single FFmpeg command?

It uses -filter_complex to split the input stream into two branches: the background branch scales to fill 1080x1920 and applies boxblur, while the foreground branch scales to fit width 1080 and overlays at the vertical center.