-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
95 lines (72 loc) · 4.05 KB
/
Copy path.env.example
File metadata and controls
95 lines (72 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# ==============================================================================
# SHARED (Required for BOTH Production & Development)
# ==============================================================================
# Core System Services
PORT=3000
REDIS_URL=rediss://user:password@host:port
DATABASE_URL=postgresql://postgres.ABC-WASD-XYZ:[PASSWORD]@[aws-1-ap-south-1].pooler.supabase.com:6543/postgres
CORS_ORIGIN=*
# Azure Blob Storage (Shared Configuration)
AZURE_STORAGE_CONTAINER_NAME=video-assets
CONTAINER_DIRECTORY_1=encoded/hls/v1
AZURE_UPLOAD_BATCH_SIZE=20
AZURE_UPLOAD_RETRIES=3
# Queue Stability
# CONCURRENCY = number of parallel jobs. Each job spawns FFmpeg which uses FFMPEG_THREADS cores.
# Set to 1 for max single-job speed, or 2 to process 2 videos simultaneously (cores split between them).
WORKER_CONCURRENCY=1
# Lock must survive the entire encode pipeline (can take 30+ minutes for full-length content).
# Renewal interval should be aggressive (15s) to survive CPU-starved Node.js event loops.
JOB_LOCK_DURATION_MS=1800000
JOB_LOCK_RENEW_MS=15000
# Video Pipeline Settings
# "SINGLE_FILE" (Byte-range fMP4) or "SEGMENTED" (Standard chunks)
HLS_OUTPUT_MODE="SEGMENTED"
# CDN base URL prepended to HLS segment and init-segment URIs in variant manifests.
# Leave unset for relative paths (local dev). Set to full CDN URL for production.
DOMAIN_SUBDOMAIN_NAME=https://vod-cdn.{SUBDOMAIN}.{DOMAIN}.com
# ==============================================================================
# PERFORMANCE TUNING
# ==============================================================================
# Global FFmpeg thread count. 0 = auto-detect (recommended).
# FFmpeg uses this for demuxing, filtering, and muxing threads.
FFMPEG_THREADS=0
# x265 frame-level parallelism. How many frames encode simultaneously.
# 4 is optimal for most machines. Higher values use more RAM but increase throughput.
# Rule of thumb: 2-6 depending on available RAM (each frame buffer ~50-200MB for 4K).
X265_FRAME_THREADS=4
# x265 lookahead threads. 0 = auto-detect (recommended, uses half of frame-threads).
# Previously hardcoded to 1, which bottlenecked the rate-control analysis.
X265_LOOKAHEAD_THREADS=0
# x265 rate-control lookahead depth (frames). Higher = better bitrate distribution.
# Increased from 20 to 40 for improved VBR quality at the cost of slightly more RAM.
X265_RC_LOOKAHEAD=40
# x264 rate-control lookahead depth (frames). Higher = better VBR quality.
# Increased from 40 to 60 for improved bitrate distribution.
X264_RC_LOOKAHEAD=60
# FFmpeg 8.1: Input thread queue sizing. Prevents "Thread message queue blocking" stalls.
# Higher values help with high-bitrate 4K sources. Default 512 covers most cases.
THREAD_QUEUE_SIZE=512
# Maximum muxer queue size. FFmpeg 8.1 runs each muxer in its own thread.
# Higher values prevent the muxer thread from blocking the encoder.
MAX_MUXING_QUEUE_SIZE=4096
# Developer Override: Force the system to use ONLY one group of profiles.
# Values: 'avc_sdr', 'hvc_sdr', 'hvc_pq', 'dvh_pq', 'ALL'
TEST_VIDEO_PROFILE=ALL
# ==============================================================================
# PRODUCTION ONLY
# ==============================================================================
NODE_ENV=production
# Azure Managed Identity URL (Replaces the connection string in production for zero-trust security)
AZURE_STORAGE_ACCOUNT_URL=https://<your-storage-account-name>.blob.core.windows.net
# ==============================================================================
# DEVELOPMENT ONLY
# ==============================================================================
NODE_ENV=development
# Azure Connection String (Used locally before deploying to Managed Identity infrastructure)
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...
# Dev / Testing Overrides
# Truncates video source to N seconds to test pipelines quickly without rendering full video
TEST_DURATION_SECONDS=15
# Mock Payload Data (Used by test/queue-job.test.local.ts)
RAW_VIDEO_SOURCE_URL=http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4