Documentation

Developer
Documentation

Everything you need to integrate CompressWave into your projects or contribute to the codebase.

Quick Start Guide

Using the Web App

1

Upload Your Files

Drag & drop or click to select videos and images

2

Choose Compression Settings

Select from presets or customize advanced options

3

Compress & Download

Watch real-time progress and download your compressed files

Using the API

Install via npm
npm install compresswave
Basic usage
import { compress } from "compresswave";

const result = await compress(file, { 
  preset: "web" 
});

Compression Presets

Web Optimized

H.264, CRF 28, 720p, 128k audio

Perfect for websites and streaming platforms

Mobile Friendly

H.264, CRF 32, 480p, 96k audio

Optimized for mobile devices and slower connections

Social Media

H.264, CRF 30, 1080x1080, 128k audio

Square format for Instagram, TikTok, etc.

Email Attachment

H.264, CRF 35, 360p, 64k audio

Small file sizes perfect for email

API Examples

Basic Video Compression

// Basic video compression
import { VideoCompressor } from 'compresswave';

const compressor = new VideoCompressor({
  preset: 'web',
  onProgress: (progress) => console.log(`${progress}% complete`),
  onComplete: (result) => console.log('Compressed:', result)
});

const compressedFile = await compressor.compress(videoFile);

Image Optimization

// Smart image compression
import { ImageOptimizer } from 'compresswave';

const optimizer = new ImageOptimizer({
  quality: 0.8,
  maxWidth: 1920,
  format: 'auto', // Auto-detect best format
  progressive: true
});

const optimizedImage = await optimizer.process(imageFile);

Batch Processing

// Process multiple files
import { BatchProcessor } from 'compresswave';

const processor = new BatchProcessor({
  concurrency: 2, // Process 2 files at once
  onFileComplete: (file, result) => {
    console.log(`${file.name} compressed: ${result.compressionRatio}%`);
  }
});

const results = await processor.compressFiles(fileList);

Custom Compression Settings

// Advanced custom settings
const customCompressor = new VideoCompressor({
  codec: 'h264',
  crf: 23,
  preset: 'medium',
  audio: {
    codec: 'aac',
    bitrate: '128k'
  },
  video: {
    bitrate: '1000k',
    framerate: 30,
    resolution: { width: 1280, height: 720 }
  }
});

System Requirements

Browser Support

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+

Minimum System

  • 2GB RAM
  • Dual-core CPU
  • Hardware acceleration recommended

Storage

  • Temporary: 2x file size
  • Cache: ~50MB
  • Works offline

Security

  • HTTPS required
  • No data transmission
  • Local processing only

Architecture Overview

Video Processing

• FFmpeg.wasm for transcoding

• WebAssembly for native performance

• Web Workers for background processing

• Streaming for large files

Image Processing

• Canvas API for manipulation

• WebP/AVIF format support

• Progressive JPEG encoding

• Smart quality detection

Core Features

• Client-side processing

• Progressive Web App

• Offline functionality

• Real-time progress tracking

Contributing

CompressWave is open source! Contribute code, report bugs, or suggest features.