Skip to content

fix(export): use real source dimensions for 4K "Original" export#655

Open
AntonioIbarraOrtiz wants to merge 1 commit into
webadderallorg:mainfrom
AntonioIbarraOrtiz:fix/export_dimensions
Open

fix(export): use real source dimensions for 4K "Original" export#655
AntonioIbarraOrtiz wants to merge 1 commit into
webadderallorg:mainfrom
AntonioIbarraOrtiz:fix/export_dimensions

Conversation

@AntonioIbarraOrtiz
Copy link
Copy Markdown

@AntonioIbarraOrtiz AntonioIbarraOrtiz commented Jun 4, 2026

Pull Request Template

Description

The MP4/GIF export-dimension memos read the live videoWidth/videoHeight through videoPlaybackRef but only depended on aspectRatio/gifSizePreset. They computed once before metadata loaded, fell back to 1920x1080, and never recomputed — so a 3840x2160 recording showed and exported as 1920x1080 when "Original" was selected.

Add isPreviewReady to both memo dependency arrays so they recompute once the video is ready (videoWidth > 0). mp4OutputDimensions and the export pipeline derive from these, so the correct source size now flows to both the displayed "Original" value and the actual export.

Motivation

4K Export is not working

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

#639

Screenshots / Video

image

Testing Guide

  1. With a 4K Monitor choose Screen 1 (Primary)
  2. Click on Record Button
  3. Stop
  4. Try to export Video to MP4
  5. Original Size show 3840x2160 and export to 3840x2160

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Summary by CodeRabbit

  • Refactor
    • Optimized video editor performance by deferring dimension calculations until the preview is ready, reducing unnecessary processing.

The MP4/GIF export-dimension memos read the live videoWidth/videoHeight
through videoPlaybackRef but only depended on aspectRatio/gifSizePreset.
They computed once before metadata loaded, fell back to 1920x1080, and
never recomputed — so a 3840x2160 recording showed and exported as
1920x1080 when "Original" was selected.

Add isPreviewReady to both memo dependency arrays so they recompute once
the video is ready (videoWidth > 0). mp4OutputDimensions and the export
pipeline derive from these, so the correct source size now flows to both
the displayed "Original" value and the actual export.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f141168a-0465-4051-916f-ad6cc479cb19

📥 Commits

Reviewing files that changed from the base of the PR and between 375620b and 755aebb.

📒 Files selected for processing (1)
  • src/components/video-editor/VideoEditor.tsx

📝 Walkthrough

Walkthrough

This PR adds isPreviewReady to the dependency arrays of two useMemo hooks in the VideoEditor component. The gifOutputDimensions and desiredMp4SourceDimensions computations now recompute when the preview becomes ready, in addition to their existing dependencies.

Changes

Preview Readiness Dependencies

Layer / File(s) Summary
GIF and MP4 dimension memoization dependency updates
src/components/video-editor/VideoEditor.tsx
gifOutputDimensions and desiredMp4SourceDimensions useMemo dependency arrays are extended to include isPreviewReady, ensuring these dimension computations refresh when preview becomes ready.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

  • Export to mp4 don't have 4K Support #639: Adding isPreviewReady to the useMemo for desiredMp4SourceDimensions directly addresses MP4 source dimension recalculation when preview becomes ready, which relates to exported MP4 resolution concerns.

Possibly related PRs

  • webadderallorg/Recordly#462: Both PRs modify src/components/video-editor/VideoEditor.tsx around desiredMp4SourceDimensions—one gates its useMemo recomputation on preview readiness while the other refactors how that dimension is computed.

Suggested labels

Checked

Poem

🐰 A rabbit hops through memos fine,
Adding gates to dimension's line,
When preview wakes, dimensions bloom,
Fresh calculations light the room! 🎬

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main bug fix: correcting export dimensions for 4K 'Original' export mode, which directly addresses the core issue in the changeset.
Description check ✅ Passed The description comprehensively covers all required template sections: clear problem explanation, motivation, bug fix type selection, related issue link, screenshot/video inclusion, detailed testing guide, and completed checklist items.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants