Conversation
The export canvas follows the source with no ceiling, so a full-screen capture of a 5K panel at backing scale 2 (5120 x 2880) produced a 2880 x 5120 canvas for 9:16 exports: 14.7 megapixels read back per frame and taller than H.264 hardware encoders accept. Exports stalled or failed at every tier. calculateMp4SourceDimensions now caps the derived canvas at 3840 on the long side and 2160 on the short side, for native and fixed-aspect exports alike, and every quality tier scales from the capped canvas. Sources at or below 4K are unchanged. Verified on a 179 s 5K capture: Medium at 9:16 exported 1620 x 2880, 4307 frames at 24 fps. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A per-side ceiling (3840 long, 2160 short) also shrank wide or tall sources that were already inside the area of 4K UHD, such as a 5120 x 1440 ultrawide, whose Original export was fine. The cap is now a pixel budget equal to 4K UHD's area: a canvas over the budget scales by the square root of the ratio, keeping its shape, and anything under it keeps its size. The 5K-to-9:16 case lands on the same 2160 x 3840 canvas as before. The previous commit's claim that exports failed at every tier was not verified; only Original was observed failing before the proxy route. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughChangesThe MP4 export dimension logic adds a 4K UHD pixel ceiling. Oversized canvases scale down proportionally and normalize to even dimensions. Native and fitted source dimensions now use the ceiling. Tests cover 5K, 4K, portrait, crop, ultrawide, and custom-budget cases. Export canvas cap
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The canvas cap and export-tier paths are covered without an identified current-head issue, so the change is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Caps the export canvas that the MP4 quality tiers scale from at the pixel area of 4K UHD (3840 x 2160). A canvas over that area is scaled down by the square root of the ratio, keeping its shape; anything at or under it keeps its size. The cap applies to native and fixed-aspect exports alike, before the quality tier scale.
Two files change:
src/components/video-editor/exportDimensions.ts(aMAX_EXPORT_CANVAS_PIXELSconstant and acapExportCanvasDimensionshelper, applied insidecalculateMp4SourceDimensions) and its test file.Motivation
A full-screen capture of a 5K display (5120 x 2880) exported at 9:16 produces a 2880 x 5120 canvas: 14.7 megapixels read back per frame and taller than H.264 hardware encoders accept. The export never completes and nothing is logged. The encoder support probe does not catch it. See the linked issue for the full reproduction.
With the cap, the same project's tiers become 1296 x 2304, 1620 x 2880, 1944 x 3456 and 2160 x 3840, and the Medium export completes on the original 5K source with no proxy.
Sources at or below 4K UHD are unchanged. This includes 4K displays at any ratio and a 5120 x 1440 ultrawide, which is under the area and keeps its size.
The trade-off, stated plainly: on displays above 4K, "Original" is no longer the source size, and every tier scales from the capped canvas. Medium on a 5K 16:9 screen drops from 3840 x 2160 to 2880 x 1620. If you would rather expose the ceiling as a setting or use a different budget, the constant is the only thing to change.
Type of Change
Related Issue(s)
Fixes #977. Related: #653 (the Level 6.0 decoder deadlock on 5K and 6K sources reported against 1.3.4-beta.1; the same Level 6.0 source decoded on current main in my testing, so this PR addresses the canvas size, not the decoder, and does not add the watchdog suggested there) and #639 (Original on a 4K source exporting below 4K; sources at or below 4K UHD are untouched by this change).
Screenshots / Video
Export settings menu on the 5K source, 9:16, before and after:
A screenshot of the menu after the change can be attached here.
Testing Guide
Unit tests:
Twelve new cases cover the 5K native and 9:16 paths, native crops above and below the budget, an ultrawide inside the budget, an ultrawide above it, a sweep of six oversize screens checking the result never exceeds the budget after rounding to even dimensions, and the resulting quality tiers. The full suite passes (1,195 tests), as do
tscandbiome check.Manual check on a display larger than 4K UHD:
On a 1080p, 1440p or 4K display, the tier sizes are unchanged from
main.Verified on macOS 26, M4 Max, Dell U4320Q at 5120 x 2880: a 179 s 9:16 export at Medium completed at 1620 x 2880, 4,307 frames at 24 fps.
Checklist
Summary by CodeRabbit