A local video processing and playback app built with Next.js.
It accepts uploaded videos, transcodes them into DASH format with FFmpeg in a background worker, and plays ready streams in the browser via Media Source Extensions (MSE).
This project provides an end-to-end local streaming workflow:
- upload a source video from the UI
- process it asynchronously into DASH segments + manifest
- track processing status (
pending,processing,ready,failed) - play the final stream from local filesystem-backed endpoints
It is designed for local development and feature iteration (no cloud storage or database yet).
- Framework: Next.js 14 (App Router)
- Language: TypeScript + React 18
- Data Fetching: TanStack Query
- UI: Radix UI primitives + shadcn-style component patterns
- Processing: FFmpeg (DASH generation)
- Background Scheduling:
cronnpm package (worker loop) - Storage: Local filesystem under
videos/
- User uploads a video through
/api/videos/upload. - A video record is created with
pendingstatus. - Background worker scans for jobs every ~15 seconds.
- FFmpeg converts input into DASH output (
manifest.mpd+ segments). - Status is updated to:
readyon successfailedon processing error
- Client polls list/status APIs and plays ready media through MSE.
pending -> processing -> ready | failed
All runtime assets are stored on disk:
videos/uploads/<videoId>/<original-file>videos/dash/<videoId>/manifest.mpd(+ segment files)videos/records/<videoId>.jsonvideos/locks/<videoId>.lock
- Node.js 18+ (recommended modern LTS)
- npm
- FFmpeg available in your system
PATH
Check FFmpeg:
ffmpeg -versionInstall dependencies:
npm installRun development server:
npm run devCreate production build:
npm run buildStart production server (after build):
npm run startIf Next.js build cache gets corrupted with route resolution issues:
rm -rf .next && npm run build- Worker initialization is triggered by server init imports in API routes.
- The app currently has no authentication/authorization layer.
- This is a filesystem-first implementation (no DB/S3 integration yet).

