diff options
Diffstat (limited to 'stream/src')
-rw-r--r-- | stream/src/segment.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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, + } +} |