fix: build error
This commit is contained in:
parent
244cbbeeab
commit
49f4b27a46
|
|
@ -5679,6 +5679,7 @@ dependencies = [
|
|||
"criterion",
|
||||
"dirs 5.0.1",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tempfile",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ categories = ["multimedia::video", "multimedia::images"]
|
|||
tokio = { version = "1.0", features = ["full"] }
|
||||
anyhow = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
uuid = { version = "1.0", features = ["v4"] }
|
||||
tempfile = "3.0"
|
||||
async-trait = "0.1"
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ impl FilterProcessor {
|
|||
}
|
||||
|
||||
// 执行 CPE
|
||||
let mut cpe_cmd = vec![
|
||||
let cpe_cmd = vec![
|
||||
"-y", "-hide_banner", "-nostdin",
|
||||
"-i", input_path.to_str().unwrap(),
|
||||
"-filter_complex", &cpe_filter,
|
||||
|
|
@ -313,7 +313,7 @@ impl FilterProcessor {
|
|||
}
|
||||
|
||||
/// 添加编码参数
|
||||
fn add_encoding_args(&self, args: &mut Vec<&str>, quality: &QualityLevel, options: &ProcessOptions) {
|
||||
fn add_encoding_args(&self, args: &mut Vec<&str>, quality: &QualityLevel, _options: &ProcessOptions) {
|
||||
// 根据质量等级选择编码参数
|
||||
match quality {
|
||||
QualityLevel::Fast => {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use crate::core::{TvaiError, TvaiProcessor, ProcessResult, ProgressCallback};
|
|||
use crate::config::UpscaleModel;
|
||||
|
||||
/// 滤镜组合类型
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub enum FilterCombination {
|
||||
/// 超分辨率放大
|
||||
Upscale {
|
||||
|
|
@ -50,7 +50,7 @@ pub enum FilterCombination {
|
|||
}
|
||||
|
||||
/// 质量等级
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize)]
|
||||
pub enum QualityLevel {
|
||||
/// 快速处理
|
||||
Fast,
|
||||
|
|
@ -63,7 +63,7 @@ pub enum QualityLevel {
|
|||
}
|
||||
|
||||
/// 处理选项
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct ProcessOptions {
|
||||
/// 输出格式 (mp4, mov, avi 等)
|
||||
pub output_format: Option<String>,
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ impl PresetBuilder {
|
|||
}
|
||||
|
||||
/// 自定义预设
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct CustomPreset {
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
|
|
|
|||
|
|
@ -231,8 +231,7 @@ impl ModelManager {
|
|||
guide.push_str(&format!("```\n\"{}\"\n```\n", topaz_exe.display()));
|
||||
}
|
||||
|
||||
fs::write(output_path, guide)
|
||||
.map_err(|e| TvaiError::IoError(format!("Failed to write guide: {}", e)))?;
|
||||
fs::write(output_path, guide)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -242,7 +241,7 @@ impl ModelManager {
|
|||
if let Some(topaz_exe) = &self.topaz_exe {
|
||||
Command::new(topaz_exe)
|
||||
.spawn()
|
||||
.map_err(|e| TvaiError::ProcessError(format!("Failed to launch Topaz: {}", e)))?;
|
||||
.map_err(|e| TvaiError::ProcessingError(format!("Failed to launch Topaz: {}", e)))?;
|
||||
Ok(())
|
||||
} else {
|
||||
Err(TvaiError::TopazNotFound("Topaz Video AI executable not found".to_string()))
|
||||
|
|
@ -274,7 +273,7 @@ impl ModelManager {
|
|||
let output = Command::new(&self.topaz_ffmpeg)
|
||||
.args(&args)
|
||||
.output()
|
||||
.map_err(|e| TvaiError::ProcessError(format!("Failed to execute FFmpeg: {}", e)))?;
|
||||
.map_err(|e| TvaiError::ProcessingError(format!("Failed to execute FFmpeg: {}", e)))?;
|
||||
|
||||
// 清理临时文件
|
||||
let _ = fs::remove_file(&output_file);
|
||||
|
|
|
|||
Loading…
Reference in New Issue