diff options
Diffstat (limited to 'transcoder')
-rw-r--r-- | transcoder/Cargo.toml | 6 | ||||
-rw-r--r-- | transcoder/src/fragment.rs | 8 | ||||
-rw-r--r-- | transcoder/src/image.rs | 4 | ||||
-rw-r--r-- | transcoder/src/lib.rs | 3 | ||||
-rw-r--r-- | transcoder/src/thumbnail.rs | 16 |
5 files changed, 18 insertions, 19 deletions
diff --git a/transcoder/Cargo.toml b/transcoder/Cargo.toml index 2343ec6..e49bd2a 100644 --- a/transcoder/Cargo.toml +++ b/transcoder/Cargo.toml @@ -9,14 +9,14 @@ jellybase = { path = "../base" } jellyremuxer = { path = "../remuxer" } log = { workspace = true } # TODO: change this back to crates.io when pr is merged -image = "0.24.9" +image = "0.25.1" # image = { git = "https://github.com/metamuffin/image-rs", features = [ # "avif-decoder", # ] } -libavif-image = { version = "0.12.0", default-features = false, features = [ +libavif-image = { version = "0.13.0", default-features = false, features = [ "codec-dav1d", ] } -anyhow = "1.0.82" +anyhow = "1.0.86" rgb = "0.8.37" rav1e = { version = "0.7.1", default-features = false, features = [ "threading", diff --git a/transcoder/src/fragment.rs b/transcoder/src/fragment.rs index 7695a48..ecb73d5 100644 --- a/transcoder/src/fragment.rs +++ b/transcoder/src/fragment.rs @@ -22,7 +22,7 @@ pub async fn transcode( enc: &EncodingProfile, input: impl FnOnce(ChildStdin), ) -> anyhow::Result<CachePath> { - Ok(async_cache_file( + async_cache_file( &["frag-tc", key, &format!("{enc:?}")], move |mut output| async move { let _permit = LOCAL_VIDEO_TRANSCODING_TASKS.acquire().await?; @@ -78,9 +78,9 @@ pub async fn transcode( let mut proc = Command::new("ffmpeg") .stdin(Stdio::piped()) .stdout(Stdio::piped()) - .args(&["-f", "matroska", "-i", "pipe:0"]) + .args(["-f", "matroska", "-i", "pipe:0"]) .args(args) - .args(&["-f", "webm", "pipe:1"]) + .args(["-f", "webm", "pipe:1"]) .spawn()?; // let mut proc = Command::new("cat") // .stdin(Stdio::piped()) @@ -98,5 +98,5 @@ pub async fn transcode( Ok(()) }, ) - .await?) + .await } diff --git a/transcoder/src/image.rs b/transcoder/src/image.rs index 3589ab9..3d7cb2d 100644 --- a/transcoder/src/image.rs +++ b/transcoder/src/image.rs @@ -22,7 +22,7 @@ pub async fn transcode( speed: u8, width: usize, ) -> anyhow::Result<CachePath> { - Ok(async_cache_file( + async_cache_file( &[ "image-tc", path.clone().as_os_str().to_str().unwrap(), @@ -96,5 +96,5 @@ pub async fn transcode( Ok(()) }, ) - .await?) + .await } diff --git a/transcoder/src/lib.rs b/transcoder/src/lib.rs index 7bf2c12..fe44a1c 100644 --- a/transcoder/src/lib.rs +++ b/transcoder/src/lib.rs @@ -3,8 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2024 metamuffin <metamuffin.org> */ -#![feature(async_closure)] -#![feature(exit_status_error)] +#![feature(async_closure, exit_status_error)] use tokio::sync::Semaphore; pub mod fragment; diff --git a/transcoder/src/thumbnail.rs b/transcoder/src/thumbnail.rs index 9661fd0..c8bfb1c 100644 --- a/transcoder/src/thumbnail.rs +++ b/transcoder/src/thumbnail.rs @@ -5,7 +5,7 @@ use std::{path::Path, process::Stdio}; use tokio::{io::copy, process::Command}; pub async fn create_thumbnail(path: &Path, time: f64) -> anyhow::Result<CachePath> { - Ok(async_cache_file( + async_cache_file( &["thumb", path.to_str().unwrap(), &format!("{time}")], move |mut output| async move { let _permit = LOCAL_IMAGE_TRANSCODING_TASKS.acquire().await?; @@ -13,12 +13,12 @@ pub async fn create_thumbnail(path: &Path, time: f64) -> anyhow::Result<CachePat let mut proc = Command::new("ffmpeg") .stdout(Stdio::piped()) - .args(&["-ss", &format!("{time}")]) - .args(&["-f", "matroska", "-i", path.to_str().unwrap()]) - .args(&["-frames:v", "1"]) - .args(&["-c:v", "qoi"]) - .args(&["-f", "image2"]) - .args(&["-update", "1"]) + .args(["-ss", &format!("{time}")]) + .args(["-f", "matroska", "-i", path.to_str().unwrap()]) + .args(["-frames:v", "1"]) + .args(["-c:v", "qoi"]) + .args(["-f", "image2"]) + .args(["-update", "1"]) .arg("pipe:1") .spawn()?; @@ -30,5 +30,5 @@ pub async fn create_thumbnail(path: &Path, time: f64) -> anyhow::Result<CachePat Ok(()) }, ) - .await?) + .await } |