45 lines
1.3 KiB
Rust
45 lines
1.3 KiB
Rust
//! Basic usage example for the tvai library
|
|
|
|
use tvai::*;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
|
|
println!("Topaz Video AI Library - Basic Usage Example");
|
|
|
|
// Detect Topaz installation
|
|
if let Some(topaz_path) = detect_topaz_installation() {
|
|
println!("Found Topaz Video AI at: {}", topaz_path.display());
|
|
|
|
// Create configuration
|
|
let config = TvaiConfig::builder()
|
|
.topaz_path(topaz_path)
|
|
.use_gpu(true)
|
|
.build()?;
|
|
|
|
// Create processor
|
|
let _processor = TvaiProcessor::new(config)?;
|
|
println!("Processor created successfully");
|
|
|
|
// Check GPU support
|
|
let gpu_info = detect_gpu_support();
|
|
println!("GPU available: {}", gpu_info.available);
|
|
|
|
// Example: Quick video upscaling (commented out as it requires actual files)
|
|
/*
|
|
let result = quick_upscale_video(
|
|
Path::new("input.mp4"),
|
|
Path::new("output.mp4"),
|
|
2.0,
|
|
).await?;
|
|
|
|
println!("Processing completed in {:?}", result.processing_time);
|
|
*/
|
|
|
|
println!("Example completed successfully!");
|
|
} else {
|
|
println!("Topaz Video AI not found. Please install it first.");
|
|
}
|
|
|
|
Ok(())
|
|
}
|