A modern, cloud-native audio/video processing platform built with React and Node.js, featuring direct Cloudflare R2 integration for cost-effective, scalable media processing.
- π΅ Extract Audio Tracks - Extract multiple audio tracks from videos with batch processing
- π Audio Format Conversion - Convert between MP3, WAV, M4A, AAC, OGG, FLAC
- ποΈ Audio Compression - Reduce file sizes with configurable bitrate settings
- πΉ Video Compression - Compress videos with H.264/H.265 codecs
- π― Resolution Scaling - Downscale to 1080p, 720p, or 480p
- π Push Notifications - Get notified when processing completes
- βοΈ Cloud-Native Architecture - Direct browser-to-R2 uploads/downloads
- π Real-Time Progress - Live FFmpeg progress via Server-Sent Events (SSE)
- π¦ Job Queue System - Automatic queueing with position tracking
- π Batch Processing - Process multiple tracks/files sequentially
- πΎ Zero Disk Usage - Fully R2-based, no local file storage
- π¨ Modern UI - Beautiful, responsive React interface
Browser β Backend (Upload) β Disk β FFmpeg β Disk β Backend β Browser (Download)
Cost: ~$18/month for 1000 videos
Bottleneck: Backend bandwidth, disk I/O
Browser β R2 (Direct Upload)
Backend β R2 (Download) β FFmpeg β R2 (Upload)
R2 β Browser (Direct Download)
Cost: ~$32/month for 1000 videos (with backend processing egress)
Benefits: 3x capacity on free tier, better scalability
- βοΈ React 18
- π¨ TailwindCSS (custom design system)
- π Web Push API
- π‘ Server-Sent Events (SSE)
- π¦ Vite
- π’ Node.js + Express
- π¬ FFmpeg (static binaries)
- βοΈ Cloudflare R2 (AWS S3-compatible)
- ποΈ MongoDB
- π Web Push (VAPID)
- π₯ Firebase App Hosting (Backend)
- π₯ Firebase Hosting (Frontend)
- βοΈ Cloudflare R2 (Object Storage)
- Node.js 18+
- MongoDB instance
- Cloudflare R2 account
- Firebase account (for deployment)
- Clone the repository
git clone https://github.com/yourusername/av-utility-platform.git
cd av-utility-platform- Install dependencies
Frontend:
cd avutility
npm installBackend:
cd server
npm install- Configure Environment Variables
Create server/.env:
# MongoDB
MONGODB_URI=mongodb://localhost:27017/avutility
# Cloudflare R2
R2_ACCOUNT_ID=your_cloudflare_account_id
R2_ACCESS_KEY_ID=your_r2_access_key_id
R2_SECRET_ACCESS_KEY=your_r2_secret_access_key
R2_BUCKET_NAME=av-utility-media
R2_PUBLIC_URL=https://your-r2-bucket.r2.dev
# Job Configuration
MAX_CONCURRENT_JOBS=2
JOB_TIMEOUT_MINUTES=30
SIGNED_URL_EXPIRY=300
# Web Push (Optional)
VAPID_PUBLIC_KEY=your_vapid_public_key
VAPID_PRIVATE_KEY=your_vapid_private_key
VAPID_SUBJECT=mailto:your@email.com
# Server
PORT=3000Create avutility/.env:
VITE_API_BASE_URL=http://localhost:3000- Configure Cloudflare R2
Follow the detailed setup guide: server/R2_SETUP_GUIDE.md
Terminal 1 (Backend):
cd server
npm run dev
# or
nodemon server.jsTerminal 2 (Frontend):
cd avutility
npm run devAccess the app at http://localhost:5173
Frontend:
cd avutility
npm run buildBackend:
cd server
npm startThe project includes comprehensive testing tools:
cd server
# Test R2 service integration
node tests/test-r2-service.js
# Test API endpoints
node tests/test-api-endpoints.js
# Open interactive web test client
# Then navigate to: http://localhost:3000/tests/test-client.htmlSee server/TESTING_GUIDE.md for detailed testing instructions.
Complete API documentation: server/API_DOCUMENTATION.md
POST /api/upload-url- Generate signed upload URLPOST /api/start-job- Start processing jobGET /api/job-status/:jobId- SSE progress streamGET /api/download-url/:jobId- Generate signed download URLPOST /api/cleanup/:jobId- Cleanup job files
Extract multiple audio tracks from a single video automatically:
- Upload video β Analyze
- Select multiple tracks (e.g., Track 1, 3, 5)
- Click "Extract X Selected Tracks"
- Watch automatic sequential processing
- Download all files individually or batch download
When concurrent job limit is reached:
- Shows queue position (e.g., "Position #3")
- Displays estimated wait time
- Auto-starts when slot available
- Smooth transition from queued β processing
Download URLs are generated fresh on-click to prevent expiration:
- 5-minute expiry on signed URLs
- Regenerated when user clicks download
- No expiration possible
- Can wait hours between extraction and download
- Bandwidth: 10 GiB/month
- Capacity: ~196 videos/month (100MB videos β 50MB outputs)
- Storage: 10 GB
- Operations: 1M Class A, 10M Class B per month
- Egress: 10 GB/month to internet (free within Cloudflare)
- R2 egress: $0.36/GB (backend processing)
- Firebase egress: $0.12/GB (output to R2)
- Total: ~$0.048 per 100MB video
- Old: 67 videos/month max (exceeded bandwidth at 10GB)
- New: 196 videos/month (3x capacity improvement)
- Install Firebase CLI
npm install -g firebase-tools
firebase login- Initialize Firebase
firebase init
# Select: Hosting, App Hosting- Deploy
# Deploy frontend
cd avutility
npm run build
firebase deploy --only hosting
# Deploy backend
cd server
firebase deploy --only apphostingSee server/API_DOCUMENTATION.md#deployment for detailed deployment guide.
av-utility-platform/
βββ avutility/ # React frontend
β βββ src/
β β βββ components/ # Reusable components (QueueStatus, etc.)
β β βββ hooks/ # Custom hooks (useR2Upload, useJobProcessing)
β β βββ pages/ # Page components
β β β βββ tools/ # Processing tools (ExtractAudio, CompressVideo, etc.)
β β βββ utils/ # Utilities (r2ApiService, etc.)
β βββ public/
β
βββ server/ # Node.js backend
β βββ controllers/ # Route handlers (mediaController, etc.)
β βββ services/ # Business logic (r2Service, ffmpegService, jobService)
β βββ routes/ # API routes
β βββ utils/ # Utilities (pushService, cleanupUtil)
β βββ tests/ # Test scripts and client
β βββ temp/ # Temporary FFmpeg processing (auto-cleaned)
β
βββ .env.example # Environment template
βββ API_DOCUMENTATION.md # Complete API docs
βββ R2_SETUP_GUIDE.md # R2 configuration guide
βββ TESTING_GUIDE.md # Testing instructions
- β Private R2 bucket (no public access)
- β Short-lived signed URLs (5 min expiry)
- β CORS configured for specific origins
- β Input validation on all endpoints
- β Job timeout limits (30 min default)
- β Automatic cleanup of processed files
- Cloudflare Workers migration (zero egress costs)
- User authentication and accounts
- File history and management
- Additional video formats (AVI, MKV, WebM)
- Thumbnail generation
- Video trimming/splitting
- Subtitle extraction
- Mobile app (React Native)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- FFmpeg - Video/audio processing
- Cloudflare R2 - Object storage
- Firebase - Hosting and backend
- fluent-ffmpeg - FFmpeg wrapper
For issues, questions, or feature requests:
- π Open an issue
- π¬ Discussions
Made with β€οΈ using React, Node.js, and Cloudflare R2