Skip to content

[FEATURE] Implement Background Processing with Web Workers for Non-Blocking Export #839

@Hrithik-ui753

Description

@Hrithik-ui753

Feature Description

Introduce a background processing system for video export by leveraging Web Workers to offload FFmpeg.wasm operations from the main thread. This will ensure a smooth, responsive user interface even during heavy video processing tasks.

Problem this Solves

Currently, the application performs video export directly on the main thread using FFmpeg.wasm. This leads to:

UI freezing during export operations
Browser tab becoming unresponsive for large or complex files
Degraded user experience, especially on low-end devices

This limitation significantly impacts usability and scalability of the application.

Proposed Solution

Implement a multi-threaded export mechanism using Web Workers:

Move FFmpeg processing logic into a dedicated Web Worker
Use postMessage() API for communication between main thread and worker
Send video data and export configurations to the worker
Receive real-time progress updates and completion signals

Enhancements to include:

📊 Real-time progress indicator
🔄 Export status updates (Processing / Completed / Failed)
❌ Option to cancel ongoing export
⚠️ Robust error handling and fallback mechanisms
Alternatives Considered
Main-thread optimization: Limited impact; UI blocking persists
Reducing processing complexity: Does not eliminate freezing
Server-side processing: Adds backend overhead, latency, and infrastructure dependency

Compared to these, Web Workers provide a scalable and efficient client-side solution.

Additional Context

This feature directly addresses existing performance-related issues (e.g., browser freezing during export) and aligns with improving responsiveness and user experience across the platform.

Implementing this will:

Enhance performance and scalability
Improve reliability of export functionality
Potentially resolve multiple open performance-related issues
Suggested Labels

enhancement feature performance refactor

Request

I would like to work on this feature. Kindly assign this issue to me.

If you want to go even stronger 🔥
I can also give you:

exact folder structure
worker.js + main thread code
how to integrate FFmpeg.wasm properly

Just say 👍

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions