From 50b66f818d3d890e2ee13c88c404031faaeea7ba Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 2 Oct 2023 11:25:15 +0200 Subject: tempfile --- transcoder/src/snippet.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 transcoder/src/snippet.rs (limited to 'transcoder/src/snippet.rs') diff --git a/transcoder/src/snippet.rs b/transcoder/src/snippet.rs new file mode 100644 index 0000000..c7033d8 --- /dev/null +++ b/transcoder/src/snippet.rs @@ -0,0 +1,30 @@ +/* + This file is part of jellything (https://codeberg.org/metamuffin/jellything) + which is licensed under the GNU Affero General Public License (version 3); see /COPYING. + Copyright (C) 2023 metamuffin +*/ + +use jellybase::{cache::async_cache_file, AssetLocationExt}; +use jellycommon::AssetLocation; + +pub async fn transcode( + asset: AssetLocation, + quality: f32, + speed: u8, + width: usize, +) -> anyhow::Result { + let original_path = asset.path(); + let asset = asset.clone(); + Ok(async_cache_file( + &[ + "snip-tc", + original_path.as_os_str().to_str().unwrap(), + &format!("{width} {quality} {speed}"), + ], + move |output| async move { + + Ok(()) + }, + ) + .await?) +} -- cgit v1.2.3-70-g09d2