Introduction
RelaxTube is a feature-rich and scalable application designed to demonstrate the workflow of video transcoding and streaming. The project highlights the use of modern technologies like Node.js, React, Kafka, FFmpeg, MongoDB, and Docker. It efficiently processes videos by transcoding them into multiple quality levels, segmenting them for smoother streaming, and generating thumbnail previews.
This blog explores the architecture, key features, tech stack, installation, and potential enhancements for RelaxTube.
Key Features
- Video Transcoding: Converts videos into multiple quality levels (360p, 480p, 720p, 1080p) using FFmpeg.
- HLS Segmentation: Generates video segments for efficient HTTP Live Streaming (HLS) playback.
- Thumbnail Generation: Automatically creates thumbnail previews for each uploaded video.
- Batch Processing: Supports concurrent video processing using Kafka message queues.
- Scalable Design: Built to handle increased loads and integrate with distributed systems.
- Storage and Metadata: Manages video files in local storage and metadata in MongoDB.
Project Architecture
Components
- Frontend (React): Provides a user-friendly interface for video uploads, management, and playback.
- Backend (Node.js with Express): Handles API requests, video processing workflows, and communication with Kafka.
- Kafka: Manages message queues for efficient batch processing.
- Transcoding Service (FFmpeg): Handles video transcoding, segmentation, and thumbnail creation.
- MongoDB: Stores metadata like video information, quality levels, and thumbnails.
- File Storage: Stores processed video files and thumbnails locally.
Tech Stack
- Node.js: Backend logic and API endpoints.
- React: Frontend for user interaction.
- Kafka: Manages distributed message queues for scalability.
- FFmpeg: Performs video transcoding, segmentation, and thumbnail generation.
- MongoDB: Stores metadata and provides quick access to processed data.
- Docker: Ensures easy setup and consistent environments.
- TailwindCSS: Enhances the frontend with modern styling.
Installation and Setup
Prerequisites
git clone https://github.com/Ravikisha/RelaxTube.git
cd RelaxTube
Steps
- Run Docker Compose
docker-compose up -d
- Install Dependencies
cd frontend && npm install
cd ../backend && npm install
cd ../transcoding-service && npm install
-
Start Services
- Backend:
cd backend npm run dev
-
Frontend:
cd frontend npm run dev
-
Transcoding Service:
cd transcoding-service npm run dev
- Access the Application Open your browser and navigate to http://localhost:3000.
Usage
- Upload Videos: Users can upload videos through the frontend interface.
-
Processing: The backend processes the videos by:
- Transcoding them to multiple quality levels.
- Segmenting videos for HLS playback.
- Generating thumbnails.
- Streaming: Processed videos are available for streaming via the frontend.
- Batch Processing: Upload multiple videos for concurrent processing.
Screenshots
Homepage
Video Playback
Quality Selection
Upload Interface
Batch Upload
Scalability Features
- Batch Processing: Process multiple videos simultaneously using Kafka.
- Distributed Workers: Scale horizontally by adding workers for transcoding tasks.
- Load Balancing: Distribute incoming requests across multiple backend servers.
- Cloud Storage: Potential integration with AWS S3 or Google Cloud Storage for large-scale storage.
- Monitoring: Use tools like Prometheus or Grafana for real-time monitoring and performance tracking.
Future Enhancements
- Cloud deployment for global access and scalability.
- Advanced analytics for tracking user interactions and video performance.
- User authentication and access control.
- Caching mechanisms for faster access to frequently requested content.
Contributing
We welcome contributions to RelaxTube! Feel free to submit pull requests, report issues, or suggest new features.
License
RelaxTube is licensed under the MIT License. See the LICENSE file for details.
Start exploring RelaxTube by visiting the GitHub Repository!
Top comments (0)