Skip to content

feat: export file size estimation#744

Open
Pranav-IIITM wants to merge 1 commit into
magic-peach:mainfrom
Pranav-IIITM:feat/export-file-size-estimation
Open

feat: export file size estimation#744
Pranav-IIITM wants to merge 1 commit into
magic-peach:mainfrom
Pranav-IIITM:feat/export-file-size-estimation

Conversation

@Pranav-IIITM
Copy link
Copy Markdown
Contributor

Description

Extends the existing exportEstimate.ts utility with a more accurate file size estimation model.

Changes Made

  • Fix preset resolution lookup — previously always used customWidth/customHeight even when a named preset (1080p, 4K, etc.) was selected
  • Replace 4-bucket CRF lookup with exponential curve fit based on real H.264 reference points:
    • CRF 18 ≈ 8 Mbps
    • CRF 23 ≈ 3 Mbps
    • CRF 30 ≈ 0.6 Mbps
  • Fix speed scaling — bitrate is no longer incorrectly divided by speed; speed now only scales output duration
  • Add sqrt-damped resolution multiplier for more accurate high-resolution estimates
  • Add format overhead factor:
    • webm ≈ 15% smaller
    • mkv ≈ 2% larger
    • mp4 baseline
  • Add audio track estimation (AAC 128 kbps)
  • Add unit tests covering all estimation behaviors

Related Issue

Closes #657


Type of Contribution

  • Bug fix
  • New feature
  • Documentation update
  • GSSoC contribution

Participant Info

  • GitHub Username: Pranav-IIITM
  • Contribution Level: Intermediate

Screen Recording

Video_Estimated-file-size.mp4

Checklist

  • I have read the contribution guidelines
  • My changes follow the project structure
  • I have tested my changes in Chrome, Firefox, and Safari
  • bun run lint passes
  • bunx tsc --noEmit passes
  • New interactive elements have aria-label (no new interactive elements added)
  • No console.log statements left in
  • This PR is related to a valid issue
  • Screen recording attached above

Extends the existing exportEstimate.ts utility with a more accurate
file size estimation model.

Changes:
- Fix preset resolution lookup — previously always used customWidth/Height
  even when a named preset (1080p, 4K, etc.) was selected
- Replace 4-bucket CRF lookup with exponential curve fit to real H.264
  reference points (CRF 18 ≈ 8 Mbps, 23 ≈ 3 Mbps, 30 ≈ 0.6 Mbps)
- Fix speed scaling — was incorrectly dividing bitrate by speed;
  speed now only scales output duration
- Add sqrt-damped resolution multiplier for more accurate high-res estimates
- Add format overhead factor (webm ~15% smaller, mkv ~2% larger than mp4)
- Add audio track estimate (AAC 128 kbps)
- Add unit tests covering all estimation behaviours

Closes magic-peach#657
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

@Pranav-IIITM is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added level:advanced Advanced level - 55 pts type:bug Bug fix type:docs Documentation labels May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ PR Format Check Passed — @Pranav-IIITM

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

@github-actions github-actions Bot added type:feature New feature type:performance Performance type:testing Testing labels May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @Pranav-IIITM!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

🟠 GSSoC'26 PR detected — thanks for contributing under GirlScript Summer of Code 2026!

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions github-actions Bot added the gssoc'26 GirlScript Summer of Code 2026 label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc'26 GirlScript Summer of Code 2026 level:advanced Advanced level - 55 pts type:bug Bug fix type:docs Documentation type:feature New feature type:performance Performance type:testing Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: export file size estimation — show approximate output size before exporting

1 participant