Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Core System Services
PORT=3000
REDIS_URL=rediss://user:password@host:port
DATABASE_URL=postgresql://user:password@host:port/dbname
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)
Expand All @@ -15,14 +15,45 @@ 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
JOB_LOCK_DURATION_MS=120000
JOB_LOCK_RENEW_MS=30000

# 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 (HEVC/Dolby Vision) thread pool size. Set to your vCPU count for max utilization.
# This is the BIGGEST performance lever — pools=none previously disabled ALL threading.
# Example: 32-core machine → X265_POOL_SIZE=32
X265_POOL_SIZE=32

# 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

# 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
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,7 @@ vite.config.js.timestamp-*
vite.config.ts.timestamp-*

.DS_Store
video
output
output

# DEVELOPMENT ONLY local files
tmp
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ ENV DEBIAN_FRONTEND=noninteractive
# -----------------------------------------------------------------------------
# Metadata & OCI Labels
# -----------------------------------------------------------------------------
ARG VERSION=0.2.0
ARG VERSION=0.3.0
ARG BUILD_DATE=unknown

LABEL org.opencontainers.image.title="ffmpeg-queue-worker-node" \
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "worker",
"version": "0.2.0",
"version": "0.3.0",
"description": "FFmpeg Worker Service (TypeScript)",
"repository": {
"type": "git",
Expand Down
Loading
Loading