Skip to content

Movie Delivery to Users

Introduction

This document describes in detail the technical process through which movies get from storage to the user's screen. I will explain the server architecture, communication protocol and optimizations implemented for a perfect streaming experience.

Server Architecture

The Emby platform works on a distributed client-server architecture:

Scheme DeliveryScheme Delivery Mobile

Central Server

The central server serves the entire Emby application and manages all user requests. When a user presses the "Play" button on a movie, the central server initiates the delivery process.

Storage Servers

The system uses 10-15 storage servers, each with 2TB capacities, which actually store the media content. These are dedicated servers optimized exclusively for storage and fast data delivery.

Server Coupling through Rclone

The central server communicates with storage servers using Rclone, an advanced tool for cloud file management. The connection is made through secure authentication:

Typical Rclone configuration:

bash
rclone config create storage_server1 drive client_id=YOUR_CLIENT_ID client_secret=YOUR_CLIENT_SECRET token=YOUR_ACCESS_TOKEN

Mount storage folder:

bash
rclone mount storage_server1:media /mnt/storage1 --daemon --allow-other --vfs-cache-mode full

Authentication Security

  • Client ID & Secret: Unique credentials for each server
  • Token Access: Access tokens with periodic expiration
  • Automatic Reset: Tokens are automatically renewed for maximum security

Storage Structure and Automatic Detection

Storage servers are mounted in dedicated folders on the central Windows server:

bash
**E:/RcloneStorage/server2/**
**E:/RcloneStorage/server3/**
...


**E:/RcloneStorage/server15/**

Structure Explanation:

  • Letter E: - Represents an extremely high-performance NVMe SSD dedicated exclusively for cache and fast operations
  • RcloneStorage - Main folder containing all Rclone connections
  • server1, server2, etc. - Individual folders for each connected storage server

This E: disk is a next-generation SSD optimized for:

  • Ultra-fast cache operations
  • High-speed read/writes
  • Parallel processing of multiple streams
  • Temporary storage of data in cache

Each serverX folder represents a mounted connection to one of the external storage servers, all managed through Rclone with maximum performance configurations.

Automatic Content Detection

The Emby platform continuously monitors storage folders. When a new movie appears in any storage folder:

  1. File Detection: System automatically detects the new file
  2. Metadata Scanning: Extracts title and basic information
  3. Automated Search: Queries external databases for complete metadata
  4. Processing: Adds movie to library with all information

Metadata Sources

The platform retrieves metadata from official sources:

  • IMDb - International movies and series
  • TMDb - The Movie Database
  • MyAnimeList - For anime content
  • TVDB - The TV Database for series

Advanced Performance Optimizations

Servers use extremely optimized configurations for maximum performance:

Critical Optimization Settings

Cache Settings:

  • --vfs-cache-mode full - Complete cache for fast access
  • --vfs-cache-max-size 200G - Generous space for cache
  • --vfs-cache-max-age 168h - Keeps cache for 7 days
  • --vfs-cache-min-age 0s - Immediate cache
  • --vfs-cache-poll-interval 1ms - Very fast cache checking

Performance Buffers:

  • --buffer-size 8G - Large buffer for streams
  • --vfs-read-chunk-size 512M - Large chunks for fast reading
  • --vfs-read-ahead 64G - Aggressive preloading
  • --vfs-read-chunk-size-limit 64G - Maximum chunk limit
  • --vfs-file-buffer-size 8G - Large file buffer

Parallel Processing:

  • --transfers 8192 - Multiple parallel transfers
  • --checkers 8192 - Parallel checks
  • --multi-thread-streams 4096 - Simultaneous streams
  • --multi-thread-cutoff 64K - Threshold for multi-thread
  • --transfers-accelerate 16384 - Accelerated transfers
  • --checkers-accelerate 16384 - Accelerated checks

Network Optimization:

  • --timeout 1s - Short timeout for quick rejection
  • --retries 10 - Retries for stability
  • --low-level-retries 10 - Low-level retries
  • --contimeout 500ms - Connection timeout
  • --expect-continue-timeout 250ms - Continue timeout

Optimization Benefits

These settings ensure:

  • Instant loading of movies
  • Streaming without interruptions
  • Maximum performance even under intensive use
  • Long-term stability

Real-time Monitoring

For administration, I implemented a dedicated status page:

Status Storage: https://status.adelin.org/storage/

This page allows:

  • Viewing real-time status of all servers
  • Monitoring performance and load
  • Quick detection of problems
  • Analysis of resource usage

Conclusion

The described architecture ensures a professional quality streaming experience, focusing on speed, stability and security of content delivery to users. Each component is optimized to provide maximum performance under intensive use conditions.

© 2025 Popica Adelin. All rights reserved.