Skip to content

Configuration

Rust-Srec uses a 4-layer configuration hierarchy for flexible control. See Configuration Layers for detailed architecture.

Basic Configuration

Adding Your First Streamer

  1. Open the frontend at http://localhost:15275
  2. Log in with default credentials:
    • Username: admin
    • Password: admin123!
  3. Navigate to StreamersAdd Streamer
  4. Enter:
    • Name: Display name
    • URL: Stream URL (e.g., https://www.bilibili.com/xxxx)
    • Platform: Auto-detected from URL
  5. Click Save

Global Settings

Access via SettingsGlobal Config. The settings are organized into several categories:

File Configuration

SettingDescriptionDefault
record_danmuEnable danmaku (live chat) recordingfalse
auto_thumbnailAutomatically generate video thumbnailstrue
output_folderBase directory for recordings (supports templates)/app/output
output_filename_templateFilename pattern for recorded files(see below)
output_file_formatDefault container format (mp4, flv, etc.)flv

Resource Limits

SettingDescriptionDefault
min_segment_sizeMinimum size before a segment is kept1MB
max_download_duration_secsMax duration before splitting the recording0 (disabled)
max_part_sizeMax size before splitting the recording8GB

Concurrency & Performance

SettingDescriptionDefault
max_concurrent_downloadsMax simultaneous recording tasks6
max_concurrent_uploadsMax simultaneous upload tasks3
max_cpu_jobsMax concurrent CPU-intensive tasks0 (Auto)
max_io_jobsMax concurrent I/O-intensive tasks8 (0 = Auto)
download_engineEngine used for recording (ffmpeg, mesio, etc.)mesio

Network & System

SettingDescriptionDefault
streamer_check_intervalInterval between checking streamer status60 Secs
offline_check_intervalInterval between checking offline status20 Secs
offline_detection_countRetries before marking streamer as offline3
retention_periodNumber of days to keep recordings in history30 Days
session_gap_time_secsTime to wait before considering a session complete1 Hour
enable_proxyRoute traffic through an intermediate serverfalse

Pipeline Configuration

Rust-Srec features a powerful modular pipeline system where you can add custom steps (e.g., transcripts, notifications, custom scripts) at different stages:

  • Per-segment: Runs for each recorded segment.
  • Paired Segment: Runs for video/danmaku pairs.
  • Session Complete: Runs when the entire recording session ends.

Folder Organization

Set output_folder to {streamer}/%Y-%m-%d to organize recordings by streamer with date-based subfolders. The output_filename_template can then use %H-%M-%S_{title} for the filename itself.

Environment Variables

The following environment variables can be configured in your .env file.

General

VariableDescriptionDefault
TZContainer timezoneUTC
VERSIONDocker image version taglatest

Paths

VariableDescriptionDefault
DATA_DIRDirectory for application data./data
CONFIG_DIRDirectory for platform configuration files./config
OUTPUT_DIRDirectory where recordings are stored/app/output
LOG_DIRDirectory for log files./logs

Network

VariableDescriptionDefault
API_PORTExternal port for the backend API12555
FRONTEND_PORTExternal port for the web interface15275
BACKEND_URLInternal URL for the frontend to reach the backendhttp://rust-srec:8080
HTTP_PROXYHTTP proxy server URL-
HTTPS_PROXYHTTPS proxy server URL-
NO_PROXYComma-separated list of hosts to bypass proxy-

Security & Auth

VariableDescriptionDefault
JWT_SECRETSecret key for JWT signing (Required)-
JWT_ISSUERJWT issuer identifierrust-srec
JWT_AUDIENCEJWT audience identifierrust-srec-api
SESSION_SECRETFrontend session encryption secret (Required, min 32 chars)-
COOKIE_SECURESet to true to force HTTPS-only cookies(auto)
MIN_PASSWORD_LENGTHMinimum length for user passwords8

Token Expiration

VariableDescriptionDefault
ACCESS_TOKEN_EXPIRATION_SECSJWT access token lifetime3600 (1h)
REFRESH_TOKEN_EXPIRATION_SECSJWT refresh token lifetime604800 (7d)

Backend Service

VariableDescriptionDefault
RUST_LOGLogging level (trace, debug, info, warn, error)info
DATABASE_URLSQL database connection stringsqlite:///app/data/rust-srec.db

Resource Limits (Docker)

VariableDescriptionDefault
CPU_LIMITMaximum CPUs the container can use4
MEMORY_LIMITMaximum memory the container can use4G
CPU_RESERVATIONReserved CPUs for the container1
MEMORY_RESERVATIONReserved memory for the container512M

Filename Template Variables

Rust-Srec supports two types of placeholders in output_folder and output_filename_template.

Curly Brace Variables

These are replaced with streamer or session specific metadata.

VariableDescription
{streamer}Streamer display name
{title}Current stream title
{platform}Platform name (e.g., bilibili)
{session_id}Unique ID for the recording session (only in output_folder)

Percent Placeholders (FFmpeg Style)

These are replaced with date, time, or sequence information.

VariableDescription
%YYear (YYYY)
%mMonth (01-12)
%dDay (01-31)
%HHour (00-23)
%MMinute (00-59)
%SSecond (00-59)
%iSequence number for split parts
%tUnix timestamp
%%Literal percent sign

Example: {streamer}/%Y-%m-%d/%H-%M-%S_{title}