D
DreamLake

Overview

Introduction

BSS is the S3-first media storage and streaming server. All binary data in DreamLake — videos, audio, labels, text tracks — flows through BSS to S3.

Architecture

Client upload

    ├── Multipart upload ──→ BSS ──→ S3 staging pool
/{owner}/{project}/staging/{hash}

    └── POST /lambdas/hls-split ──→ AWS Lambda

                                       ├── HLS chunks → S3 chunks/{hash}.ts
                                       └── Playlist   → S3 videos/{id}/stream/{hash}.m3u8

Core Concepts

ConceptDescription
Staging PoolFlat S3 prefix {owner}/{project}/staging/{hash} — holds raw uploaded files
HLS SplittingLambda splits video into chunked TS segments + m3u8 playlists
Content AddressingChunks are deduped by hash in a global chunks/ pool
MetadataJSON sidecar files in S3 per video/audio/track

S3 Layout

{owner}/{project}/
  staging/{hash}                    # Raw uploaded files
  videos/{videoId}/
    meta.json                       # Video metadata
    stream/{hash}.m3u8              # HLS playlists
  tracks/
    labels/{labelId}/meta.json      # Label track metadata
    text/{textTrackId}/meta.json    # Text track metadata
    audio/{audioId}/meta.json       # Audio metadata
chunks/
  {hash}.ts                         # Global chunk pool (deduped)

API Endpoints

MethodPathDescription
POST/videos/upload/multipart/initStart multipart upload
POST/videos/upload/multipart/completeFinalize upload
POST/lambdas/hls-splitTrigger HLS splitting Lambda
POST/lambdas/audio-processTrigger audio processing Lambda
GET/videos/:id/stream/master.m3u8HLS playback
GET/videos/:id/rawPresigned download URL (302 redirect)

Quick Start

cd big-streaming-server && pnpm dev
# → http://localhost:10234

Tech Stack

ComponentTechnology
FrameworkExpress
DatabaseMongoDB (via Prisma)
StorageAWS S3 / MinIO
ProcessingAWS Lambda (HLS splitter, audio processor)
AuthJWT