From ab7d91489b0ba4c9222f493857c98aa4331a982b Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 2 Oct 2023 15:07:16 +0200 Subject: width steps --- stream/src/segment.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'stream/src/segment.rs') diff --git a/stream/src/segment.rs b/stream/src/segment.rs index 08d3efa..fdef01c 100644 --- a/stream/src/segment.rs +++ b/stream/src/segment.rs @@ -24,6 +24,7 @@ pub async fn segment_stream( let n = spec.index.ok_or(anyhow!("segment index missing"))?; if let Some(width) = spec.width { + let width = width_steps(width); let location = transcode( "", Encoding::Video { @@ -74,3 +75,11 @@ pub async fn segment_stream( Ok(()) } + +fn width_steps(width: usize) -> usize { + match width { + x if x >= 3840 => 3840, + x if x >= 1920 => 1920, + _ => 720, + } +} -- cgit v1.2.3-70-g09d2