# API Documentation This document provides API documentation for using video_probe as a library. ## Installation Add to your Cargo.toml: ```toml [dependencies] video_probe = { path = "../video_probe" } ``` ## Quick Start ```rust use video_probe::*; fn main() -> Result<(), Box> { // Probe video let metadata = probe_video("video.mp4")?; // Access metadata println!("Duration: {} seconds", metadata.format.duration); if let Some(ref video) = metadata.video_stream { println!("Resolution: {}x{}", video.width, video.height); } // Save to file let output_file = save_metadata("video.mp4", &metadata)?; println!("Saved to: {}", output_file); Ok(()) } ``` ## Core Functions ### probe_video ```rust pub fn probe_video(video_path: &str) -> Result ``` Probes a video file and returns metadata. ### probe_video_to_file ```rust pub fn probe_video_to_file(video_path: &str) -> Result ``` Probes a video and saves metadata to JSON file. ### save_metadata ```rust pub fn save_metadata(video_path: &str, metadata: &VideoMetadata) -> Result ``` Saves metadata to a JSON file. ### print_summary ```rust pub fn print_summary(metadata: &VideoMetadata) ``` Prints formatted summary to console. ## Data Structures ### VideoMetadata - `video_path`: String - `probed_at`: DateTime - `format`: FormatInfo - `video_stream`: Option - `audio_streams`: Vec - `subtitle_streams`: Vec