A robust video processing and streaming architecture has been implemented to support high-quality educational content delivery. This system handles the entire lifecycle of video content from upload to adaptive streaming.
- Video: Core entity tracking metadata, status, and ownership.
- VideoVariant: Stores different quality versions (1080p, 720p) and formats (HLS, MP4).
- VideoAnalytics: Tracks engagement metrics like views, watch time, and retention.
- VideoService: Orchestrates CRUD operations and manages the video lifecycle.
- TranscodingService:
- Simulates ffmpeg processing pipeline.
- Handles status transitions (PENDING -> PROCESSING -> READY).
- Generates mock assets (thumbnails, previews).
- StreamingService:
- Generates HLS manifest URLs.
- Implements URL signing logic for secure playback.
- VideoController: RESTful endpoints for managing video resources.
- StreamingController: Specialized endpoints for delivering video streams.
✅ Video Upload: Multipart form-data support for video files. ✅ Asynchronous Processing: Non-blocking transcoding workflow. ✅ Adaptive Streaming: Architecture ready for HLS/DASH delivery. ✅ Analytics Ready: Schema designed for deep engagement tracking. ✅ Security: Visibility controls (Public/Private/Unlisted) and signed URL logic.
POST /api/videos
Content-Type: multipart/form-data
file: [video_file]
title: "Introduction to Blockchain"
visibility: "PRIVATE"GET /api/stream/{videoId}/manifest.m3u8- FFmpeg Integration: Replace the mock
TranscodingServicewith actualfluent-ffmpegimplementation or AWS MediaConvert integration. - Storage Provider: Implement S3/Cloudinary storage strategy for physical files.
- Webhooks: Add webhook support for external transcoding services.
- Live Streaming: Add support for RTMP ingestion and HLS live output.
CREATE TABLE videos (
id UUID PRIMARY KEY,
title VARCHAR NOT NULL,
status VARCHAR DEFAULT 'PENDING',
visibility VARCHAR DEFAULT 'PRIVATE',
...
);
CREATE TABLE video_variants (
id UUID PRIMARY KEY,
video_id UUID REFERENCES videos(id),
resolution VARCHAR,
url VARCHAR,
...
);The system is designed with dependency injection to allow easy mocking of the transcoding and storage layers during testing.
Status: ✅ Core Architecture Complete Next Steps: Configure storage provider and install ffmpeg binaries in production environment.