Skip to content

perf: Optimise FFmpeg args and show elapsed export time (#694)#1040

Merged
magic-peach merged 1 commit into
magic-peach:mainfrom
Abhi190702:feat/export-performance-issue-694
May 24, 2026
Merged

perf: Optimise FFmpeg args and show elapsed export time (#694)#1040
magic-peach merged 1 commit into
magic-peach:mainfrom
Abhi190702:feat/export-performance-issue-694

Conversation

@Abhi190702
Copy link
Copy Markdown
Contributor

@Abhi190702 Abhi190702 commented May 24, 2026

New Reframe - (30 sec clip showing , relatively fast export)

Reframe-New.online-video-cutter.com.mp4

Old Reframe - (30 sec clip showing , slow export)

Reframe-Old.online-video-cutter.com.mp4

Summary

Resolves #694

Optimises FFmpeg export settings so browser-based exports complete much faster, and adds visible elapsed export timing during and after export.

Changes Made

  • Switched x264 MP4/MKV exports from -preset medium to -preset ultrafast
  • Added VP9 speed flags: -cpu-used 4 -deadline realtime
  • Skipped the FFmpeg eq filter when brightness/contrast/saturation are neutral
  • Preserved neutral defaults: brightness 0, contrast 1, saturation 1
  • Added live elapsed time in the export overlay, e.g. 0:42 elapsed
  • Added total export duration to the download result card, e.g. Exported in 1 min 23 sec
  • Added export duration tracking through useVideoEditor
  • Added a regression test proving neutral adjustments skip eq
  • Added the minimal Vitest JSX/matchMedia setup needed for the current test suite to run cleanly

COOP/COEP

vercel.json already contains:

  • Cross-Origin-Opener-Policy: same-origin
  • Cross-Origin-Embedder-Policy: require-corp

No hosting-header changes were needed in this PR.

Testing

  • bun run lint
  • bunx tsc --noEmit
  • bun run test -- --run
  • bun run build

Note: bun run lint and bun run build still print the existing ThumbnailStrip.tsx hook warning from main, but both commands exit successfully. The build required elevated filesystem access locally because Next.js hit Windows sandbox readlink permissions.

Screen Recordings

Required before merge:

  • Before recording: export the same 1–2 minute video on current main
  • After recording: export the same video on this branch and show the elapsed timer + faster completion

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

Someone 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
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 24, 2026

✅ PR Format Check Passed — @Abhi190702

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
Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @Abhi190702!

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

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 level:intermediate Intermediate level - 35 pts type:performance Performance type:testing Testing labels May 24, 2026
@Abhi190702
Copy link
Copy Markdown
Contributor Author

@magicPeach , adding recording soon !!

@Abhi190702
Copy link
Copy Markdown
Contributor Author

@magic-peach , happy that You might look into this

@magic-peach magic-peach added gssoc'26 GirlScript Summer of Code 2026 type:feature New feature gssoc:approved Approved for GSSoC'26 labels May 24, 2026
@magic-peach magic-peach merged commit ce58ccd into magic-peach:main May 24, 2026
13 of 14 checks passed
@magic-peach
Copy link
Copy Markdown
Owner

Merged! This PR delivers meaningful performance improvements (ultrafast preset, VP9 realtime mode, skipping neutral eq filter) plus a helpful elapsed export timer in the UI. Well-tested with the regression test for neutral adjustments. All CI checks passed. Excellent work @Abhi190702!

@Abhi190702
Copy link
Copy Markdown
Contributor Author

@magic-peach , Thanks , Looking forward for More contributions and support
-- Abhijeet

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

Labels

gssoc:approved Approved for GSSoC'26 gssoc'26 GirlScript Summer of Code 2026 level:intermediate Intermediate level - 35 pts type:feature New feature type:performance Performance type:testing Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: export is extremely slow — optimise FFmpeg args and show elapsed export time

2 participants