add playout service: HLS streaming, FFmpeg, SegmentStore port (#9)

This commit is contained in:
2026-07-12 13:58:09 +02:00
parent de7f3092d2
commit 1b3ecc10e1
13 changed files with 1022 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
use std::path::PathBuf;
#[derive(Debug, Clone)]
pub struct PlayoutConfig {
pub listen_addr: String,
pub segment_duration_secs: u32,
pub window_size: usize,
pub storage_path: PathBuf,
pub tick_interval_ms: u64,
}
impl PlayoutConfig {
pub fn from_env() -> Self {
Self {
listen_addr: std::env::var("PLAYOUT_LISTEN_ADDR")
.unwrap_or_else(|_| "0.0.0.0:9090".into()),
segment_duration_secs: std::env::var("PLAYOUT_SEGMENT_DURATION")
.ok()
.and_then(|v| v.parse().ok())
.unwrap_or(6),
window_size: std::env::var("PLAYOUT_WINDOW_SIZE")
.ok()
.and_then(|v| v.parse().ok())
.unwrap_or(10),
storage_path: std::env::var("PLAYOUT_STORAGE_PATH")
.map(PathBuf::from)
.unwrap_or_else(|_| PathBuf::from("/tmp/k-tv-playout")),
tick_interval_ms: std::env::var("PLAYOUT_TICK_INTERVAL_MS")
.ok()
.and_then(|v| v.parse().ok())
.unwrap_or(1000),
}
}
}