Add main.rs
This commit is contained in:
37
src/main.rs
Normal file
37
src/main.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
use clap::Parser;
|
||||
use video_probe::*;
|
||||
use anyhow::Result;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(
|
||||
name = "video_probe",
|
||||
author,
|
||||
version,
|
||||
about = "Extract video metadata using ffprobe",
|
||||
long_about = None
|
||||
)]
|
||||
struct Args {
|
||||
/// Video file path
|
||||
video_path: String,
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let args = Args::parse();
|
||||
|
||||
println!("Probing video: {}", args.video_path);
|
||||
println!("{}", "=".repeat(60));
|
||||
|
||||
// Probe video
|
||||
let metadata = probe_video(&args.video_path)?;
|
||||
|
||||
// Save to file
|
||||
let output_file = save_metadata(&args.video_path, &metadata)?;
|
||||
|
||||
// Print summary
|
||||
print_summary(&metadata);
|
||||
|
||||
println!("\n✓ Metadata saved to: {}", output_file);
|
||||
println!("{}", "=".repeat(60));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user