How sb2702/free-ai-video-upscaler works
Free AI Video Upscaler is a browser-based tool for selecting a video, previewing it, choosing an AI upscaling network, processing it locally, and downloading the result. The main thread manages the interface and communicates with a worker; the worker initializes WebSR and delegates video processing to the active pipeline. That pipeline demuxes video, decodes and upscales frames, re-encodes them, and muxes MP4 output, with audio packets and output storage handled alongside video. The worker also supports pause/resume and reports progress. The graph follows the sampled active processor; the separate MediaBunny processor is an alternate implementation, not an asserted fallback path.
Main entry points: worker.ts Processing Worker · pipeline-processor.ts Pipeline Processor · index.ts App Interface · in-memory-storage.ts Memory Storage
Components 19
User Interface
- App Interface
src/index.ts - Preview Compare
Worker Control
- Worker Messages
src/types/worker-messages.ts - Processing Worker
src/worker.ts - AI Weights
src/weights
Video Processing
- WebSR Runtime
- Pipeline Processor
src/processors/pipeline-processor.ts - Video Demux
src/processors/pipeline-processor.ts - Frame Decode
src/processors/pipeline-processor.ts - AI Upscale
src/processors/pipeline-processor.ts - Video Encode
src/processors/pipeline-processor.ts - Audio Packets
src/processors/pipeline-processor.ts - MP4 Mux
src/processors/pipeline-processor.ts - WebDemuxer
- MediaBunny
Output
- Memory Storage
src/processors/in-memory-storage.ts - Browser Files
- Upscaled Video
Other components
- Video User
Connections 28
- Video User → App Interface: selects video
- App Interface → Preview Compare: mounts preview
- App Interface → Processing Worker: sends commands
- Processing Worker → App Interface: reports status
- App Interface → Worker Messages: uses message types
- Processing Worker → Worker Messages: uses message types
- Processing Worker → AI Weights: loads weights
- Processing Worker → WebSR Runtime: initializes runtime
- Processing Worker → WebSR Runtime: switches network
- Processing Worker → Pipeline Processor: starts processing
- Pipeline Processor → WebDemuxer: loads input
- Video Demux → WebDemuxer: reads tracks
- Pipeline Processor → Video Demux: demuxes video
- Video Demux → Frame Decode: streams chunks
- Frame Decode → AI Upscale: yields frames
- AI Upscale → WebSR Runtime: renders frames
- AI Upscale → Video Encode: passes frames
- Video Encode → MP4 Mux: writes packets
- Pipeline Processor → Audio Packets: handles audio
- Audio Packets → MP4 Mux: adds audio packets
- Pipeline Processor → MP4 Mux: creates MP4 output
- MP4 Mux → MediaBunny: writes MP4
- Pipeline Processor → Memory Storage: stores output chunks
- Pipeline Processor → Browser Files: writes selected file
- Memory Storage → Upscaled Video: builds Blob
- Browser Files → Upscaled Video: saves file
- Processing Worker → App Interface: returns completed Blob
- App Interface → Upscaled Video: provides download