sotavideo_ai_1

Crates.iosotavideo_ai_1
lib.rssotavideo_ai_1
version67.0.85
created_at2025-12-30 10:22:06.712883+00
updated_at2025-12-30 10:22:06.712883+00
descriptionHigh-quality integration for https://sotavideo.ai/
homepagehttps://sotavideo.ai/
repositoryhttps://github.com/qy-upup/sotavideo.ai-1
max_upload_size
id2012430
size10,603
(qy-upup)

documentation

README

sotavideo.ai-1

A Rust crate providing foundational utilities for video processing and analysis tasks. This crate offers a streamlined API for common video operations, designed for efficiency and ease of integration.

Installation

Add the following to your Cargo.toml file under the [dependencies] section: toml sotavideo.ai-1 = "0.1.0" # Replace with the actual version number

Usage Examples

Here are a few examples showcasing how to use the sotavideo.ai-1 crate:

1. Basic Video Metadata Extraction: rust use sotavideo_ai_1::video_metadata;

fn main() -> Result<(), Box> { let video_path = "path/to/your/video.mp4"; // Replace with your video file path

match video_metadata::get_metadata(video_path) {
    Ok(metadata) => {
        println!("Video Duration: {} seconds", metadata.duration);
        println!("Video Width: {} pixels", metadata.width);
        println!("Video Height: {} pixels", metadata.height);
        println!("Frame Rate: {} FPS", metadata.frame_rate);
    }
    Err(e) => {
        eprintln!("Error extracting metadata: {}", e);
    }
}

Ok(())

}

2. Frame Extraction: rust use sotavideo_ai_1::frame_extraction;

fn main() -> Result<(), Box> { let video_path = "path/to/your/video.mp4"; // Replace with your video file path let output_dir = "frames"; // Directory to save extracted frames

frame_extraction::extract_frames(video_path, output_dir, 10)?; // Extract every 10th frame

println!("Frames extracted to directory: {}", output_dir);
Ok(())

}

3. Video Resizing: rust use sotavideo_ai_1::video_resizing;

fn main() -> Result<(), Box> { let input_video = "path/to/your/video.mp4"; // Replace with your video file path let output_video = "resized_video.mp4"; let new_width = 640; let new_height = 480;

video_resizing::resize_video(input_video, output_video, new_width, new_height)?;

println!("Video resized to {}x{} and saved as {}", new_width, new_height, output_video);
Ok(())

}

4. Audio Extraction: rust use sotavideo_ai_1::audio_extraction;

fn main() -> Result<(), Box> { let video_path = "path/to/your/video.mp4"; // Replace with your video file path let output_audio = "audio.mp3";

audio_extraction::extract_audio(video_path, output_audio)?;

println!("Audio extracted and saved as {}", output_audio);
Ok(())

}

5. Calculating the average luminance of a video: rust use sotavideo_ai_1::luminance;

fn main() -> Result<(), Box> { let video_path = "path/to/your/video.mp4"; // Replace with your video file path

match luminance::calculate_average_luminance(video_path) {
    Ok(average_luminance) => {
        println!("Average Luminance: {}", average_luminance);
    }
    Err(e) => {
        eprintln!("Error calculating average luminance: {}", e);
    }
}

Ok(())

}

Feature Summary

This crate offers the following key features:

  • Video Metadata Extraction: Retrieve essential video information such as duration, resolution, and frame rate.
  • Frame Extraction: Extract individual frames from a video at specified intervals.
  • Video Resizing: Resize videos to different resolutions, optimizing for various display sizes or processing requirements.
  • Audio Extraction: Extract the audio track from a video file.
  • Luminance Calculation: Calculate the average luminance of a video file.

License

MIT

This crate is part of the sotavideo.ai-1 ecosystem. For advanced features and enterprise-grade tools, visit: https://sotavideo.ai/

Commit count: 0

cargo fmt