Why is my crop 606 px wide, not 607? Video filter even rounding

Video filter crop fractions are floored to even pixels so the yuv420p encode stays valid: 0.316406 of 1920 px is 606 px, not 607.5.

3 min readSume
All posts

A video-filter crop returns a width or height a pixel or two smaller than your fractions imply because every edge is rounded down to an even number. The yuv420p pixel format that makes an MP4 play everywhere stores colour at half resolution, so an odd crop edge cannot be encoded cleanly, and the compiler floors each value rather than guessing.

Sume's Video filter 1.0 takes crop as fractions of the source frame, not pixels. The docs say the compiler even-rounds for yuv420p; this post shows the exact arithmetic.

The rule, applied to a 9:16 crop of a 16:9 clip

The compiled expression for each of x, y, width and height is floor((source_edge * fraction) / 2) * 2. We ran the repository compiler on { "op": "crop", "x": 0.341797, "y": 0, "width": 0.316406, "height": 1 } against a 1920 by 1080 source, the usual centred vertical window.

A true 9:16 window on a 1080-pixel-tall frame is 607.5 pixels wide, which no encoder can store. Width fraction 0.316406 gives 607.4995, which floors to 606. The x offset, 0.341797 of 1920, is 656.25 and floors to 656. The result is a 606 by 1080 file. Its ratio is 0.5611 against 0.5625, a quarter of a percent narrow, and no visible content is lost.

Crop fraction to pixels on a 1920 by 1080 source (read 2026-10-03)
FieldFractionRaw pixelsRendered pixels
width0.316406607.50606
height110801080
x0.341797656.25656
y000

Two ways to land on an exact ratio

If a quarter of a percent is acceptable, do nothing. Platforms that accept 9:16 within a tolerance take 606 by 1080 without complaint, and the next step usually scales it anyway.

If you need an exact frame, treat the crop as a rough selection and finish in a render. Put the cropped file in a Timeline slot with the default cover fit and the default 1080 by 1920 output; the fit scales and trims the few spare rows, and the output size is exactly what you asked for. The fit post shows what the other modes do.

Check the numbers for free

POST /v1/video-filter/check runs the same schema and returns diagnostics and the compiled filter names, without creating a job or charging. The encode itself costs $0.02. Run the check with your fractions, then compute the floor yourself: choose fractions so that edge * fraction is already an even integer if you want zero loss. For a 1080-pixel-tall source and a 9:16 window, you cannot, which is the case above.

Source files up to 300 seconds are accepted by this route, and the output inherits the source's frame rate and audio unless the program changes them.

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume