vidi

module
v0.0.0-...-dec19c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: MIT

README

Vidi

Coverage

WIP

Overview

Vidi is a video service (or platform). Features include:

  • simple user registration and login
  • mp4 files upload (with h.264 AVC and mp4a AAC codecs)
  • resuming of interrupted upload
  • upload quotas per user
  • on-demand streaming of uploaded videos with MPEG-DASH

Uploaded mp4 files are pre-processed, so they could be streamed to dash clients. Preprocessing includes:

Also project uses:

  • PostgreSQL for video object storage and user storage
  • S3 compatible storage for video content
  • Redis for media sessions storage

This is my pet project and is very far from being production-ready. Nice and shiny web UI is not even planned.

Architecture

Vidi consists of several services

Userapi

Simple user registration and login service. Made with labstack/echo.

Videoapi

Main API that implements the most of the business logic, like video object CRUD operations. It is also an entry point for upload and watch flows.

Video API has service-side (for back2back comms) and user-side (user->api comms) parts. User-side is served as http with labstack/echo and as grpc. Service-side has only grpc.

Both Userapi and Videoapi are considered as API-domain.

Uploader

This service is responsible for media content upload. It uses upload sessions created by videoapi to identify and validate upload requests. Made with valyala/fasthttp.

Streamer

This service serves DASH segments to users. It uses watch sessions created by videoapi to identify and validate download requests. Made with valyala/fasthttp.

Processor

This is worker-style service that processes uploaded videos to DASH-format. Uses Eyevinn/mp4ff in its core.

Processor, uploader and streamer are considered as Media-domain.

Vidit

This is client-side tool, that provides TUI to interact with Vidi. It supports almost every operation, excluding video playback: at the moment it can generate watch url which can be used with DASH reference player (included in compose project). Made with charmbracelet/bubbletea.

Development

./docker dir contains reference all-in-one deployment with docker-compose. Nginx is used as gateway. It also has simple web page with DASH reference client to test video playback. Minio is used as self-hosted s3.

Docker

# generate certificates
make tls
# start compose project
make docker-dev
# or
make docker-dev-build # to rebuild images

# stop compose project and remove volumes
make docker-dev-clean

Tests

# run unit tests
make unittests

# run unit and e2e tests
# docker compose project should be stopped (it will be started by the command)
make test-all

Showcase

Showcase of project startup and some features

showcase

Directories

Path Synopsis
cmd
internal
api/requestid
Package requestid implements request ID generator.
Package requestid implements request ID generator.
app
cli
Package cli contains cli tool that has - helpful mp4 operations like dumping and segmenting mp4 file - video api service token creation (which can be used later in apps config).
Package cli contains cli tool that has - helpful mp4 operations like dumping and segmenting mp4 file - video api service token creation (which can be used later in apps config).
event
Package event defines generic event that sent by processor and uploader to notify videoapi about video object changes.
Package event defines generic event that sent by processor and uploader to notify videoapi about video object changes.
file
Package file provides helpers that are used during video file upload.
Package file provides helpers that are used during video file upload.
generators
Package generators provides simple unique string generator that is internally based on uuid v4.
Package generators provides simple unique string generator that is internally based on uuid v4.
logging
Package logging provides various zap logger initialization functions.
Package logging provides various zap logger initialization functions.
media/processor
Package processor contains mp4 file processor which can only do segmentation for now.
Package processor contains mp4 file processor which can only do segmentation for now.
media/streamer
Package streamer contains media segments streaming app.
Package streamer contains media segments streaming app.
media/uploader
Package uploader contains app that handles media part uploads.
Package uploader contains app that handles media part uploads.
mp4
mp4/meta
Package meta contains playback metadata definition and static MPD generator.
Package meta contains playback metadata definition and static MPD generator.
mp4/segmentation
Package segmentation contains high level functions for progressive mp4 file segmentation The code is mostly based on https://github.com/Eyevinn/mp4ff/tree/master/examples/segmenter
Package segmentation contains high level functions for progressive mp4 file segmentation The code is mostly based on https://github.com/Eyevinn/mp4ff/tree/master/examples/segmenter
tool
Package tool contains TUI client that can be used together with ViDi.
Package tool contains TUI client that can be used together with ViDi.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL