Skip to content

A robust, self-hosted media streaming platform with automatic transcoding and adaptive bitrate delivery.

Notifications You must be signed in to change notification settings

codek7-services/codek7-backend

Repository files navigation


Codek7 : the Self-Hosted Media Streaming Platform

A robust, self-hosted media streaming platform with automatic transcoding and adaptive bitrate delivery.
Explore the features »
Get Started
Wiki


Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. System Diagrams
  5. Data Model
  6. Roadmap
  7. Contributing
  8. License

About The Project

This project delivers a powerful, self-hosted media streaming solution, designed for seamless content delivery. It intelligently handles automatic transcoding of various media formats and provides adaptive bitrate delivery (HLS), ensuring a smooth and high-quality viewing experience across diverse devices and network conditions.

(back to top)

Features

  • Automatic Transcoding: Media files are automatically transcoded into multiple formats and resolutions, optimizing them for streaming.
  • Adaptive Bitrate (ABR) Delivery: Utilizes HLS (HTTP Live Streaming) to dynamically adjust video quality based on the user's network speed, minimizing buffering and maximizing viewing pleasure.
  • Scalable Architecture: Built with a microservices approach, leveraging message queues for efficient processing and scalability.
  • Object Storage Integration: Stores transcoded media files in a high-performance, S3-compatible object storage solution.
  • Modern User Interface: A responsive and intuitive web interface for managing and Browse your media library.

(back to top)

Technologies Used

  • Go
  • Rust
  • Kafka
  • RabbitMQ
  • FFmpeg
  • HLS
  • Next.js
  • MinIO
  • PostgreSQL
  • Redis

(back to top)

Architecture (High-Level)

The platform follows a distributed microservices architecture:

  1. Ingestion Service (Go/Rust): Handles uploading and initial processing of media files. Publishes events to Kafka.
  2. Transcoding Service (Go/Rust with FFmpeg): Consumes events from Kafka, performs transcoding using FFmpeg, and stores transcoded segments in MinIO. Publishes completion events to Kafka.
  3. API Gateway/Streaming Service (Go): Provides APIs for the frontend and serves HLS manifests and segments directly from MinIO.
  4. Frontend (Next.js): Communicates with the API Gateway to display media, manage uploads, and initiate playback.
  5. Database Layer (PostgreSQL & Redis): PostgreSQL stores persistent data, while Redis handles caching and real-time data.
  6. Message Queues (Kafka & RabbitMQ): Facilitate communication and task distribution between services, ensuring high availability and scalability.

(back to top)


Getting Started

To get a local copy of this streaming platform up and running, follow these simple steps.

Prerequisites

  • Docker and Docker Compose (essential for running all services)

Steps to Run

  1. Clone the project repository:
    cd codek7-backend
  2. **Build the vcodec service:
     cd vcodec
    cargo build
  3. Start all services using Docker Compose:
    docker compose up
    This command will build (if necessary) and start all the services defined in docker-compose.yml file, including Kafka, RabbitMQ, PostgreSQL, Redis, MinIO, your custom Go/Rust backend services, and the Next.js frontend application.

(back to top)


Usage

  • Once all services are up and running, you can access the frontend application in your web browser. Typically, it will be available at http://localhost:3000, but check your docker-compose.yml or frontend configuration for the exact port.
  • Upload your media files through the user interface.
  • The platform will automatically transcode and prepare your media for adaptive bitrate streaming.
  • Browse your media library and enjoy a smooth viewing experience.

(back to top)


System Diagrams

Below are various diagrams illustrating the system's architecture, data flow, and video processing states.

Overall System Architecture

This diagram provides a high-level overview of the main components and their interactions.

Overall System Architecture
Simplified Architecture

(back to top)

Video Processing Flow

This diagram details the sequence of operations from video upload to final availability, including transcoding and NSFW checking.

Video Processing Flow Detailed

(back to top)

Service Interaction Sequence

This sequence diagram illustrates the communication flow between different services during a video upload and processing cycle.

Service Interaction Sequence Diagram

(back to top)


Data Model

This entity-relationship diagram (ERD) showcases the database schema and relationships between different entities in the system.

Database Diagram

(back to top)


Roadmap

  • User authentication and authorization
  • Advanced media library management (categories, tags)
  • Search and filtering capabilities
  • Playback history and watch progress tracking
  • API for external applications
  • Multi-user support with custom profiles
  • Live streaming capabilities

(back to top)


License

Distributed under the MIT License. See LICENSE for more information.

(back to top)


About

A robust, self-hosted media streaming platform with automatic transcoding and adaptive bitrate delivery.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •