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.
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.
| Field | Fraction | Raw pixels | Rendered pixels |
|---|---|---|---|
| width | 0.316406 | 607.50 | 606 |
| height | 1 | 1080 | 1080 |
| x | 0.341797 | 656.25 | 656 |
| y | 0 | 0 | 0 |
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
- Why does my video freeze while the voiceover keeps playing?
Timeline holds the last frame when slots end before audio.duration_seconds, or leave a gap. Plan reports it free as video_coverage_shorter_than_audio.
- Video reach campaign: which video lengths to cut from one master
A Google Ads video reach campaign wants a 15 s, a 6 s and sometimes a 30 s horizontal cut, plus a vertical one. Google's compositions, and trims on Sume.
- Vimeo "Invalid Caption File": build clean WebVTT from Sume
Vimeo rejects a cue that starts at the previous cue's end. Sume sentence segments touch, so trim 1 ms, write UTF-8 WebVTT and upload. Script included.
- Webinar to Shorts: pick moments by transcript, not fixed cuts
Fixed-interval cuts make interchangeable Shorts. Read the webinar's sentence segments, choose complete thoughts, then trim and caption each with Sume.
Written by Sume