sotavideo_ai

Crates.iosotavideo_ai
lib.rssotavideo_ai
version67.0.0
created_at2025-12-30 09:52:01.966799+00
updated_at2025-12-30 10:25:43.424904+00
descriptionHigh-quality integration for https://sotavideo.ai/
homepagehttps://sotavideo.ai/
repositoryhttps://github.com/qy-upup/sotavideo.ai
max_upload_size
id2012380
size12,055
(qy-upup)

documentation

README

sotavideo.ai

A Rust crate providing utilities for interacting with and processing video data, designed to simplify common video-related tasks. This crate offers a robust and efficient foundation for building video analysis and manipulation applications.

Installation

To use sotavideo.ai in your Rust project, add the following to your Cargo.toml file: toml [dependencies] sotavideo-ai = "0.1.0" # Replace with the actual version number

Usage Examples

Here are a few examples demonstrating how to use the sotavideo.ai crate:

1. Extracting Frames from a Video:

This example demonstrates how to extract frames from a video file and save them as individual images. rust use sotavideo_ai::video_processing;

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

video_processing::extract_frames(video_path, output_directory, 30)?; // Extract every 30th frame

println!("Frames extracted successfully to {}", output_directory);
Ok(())

}

2. Detecting Objects in a Video:

This example shows how to use the crate to detect objects within a video stream. rust use sotavideo_ai::object_detection;

fn main() -> Result<(), Box> { let video_path = "path/to/your/video.mp4"; let model_path = "path/to/your/object_detection_model.onnx"; // Example ONNX model

let detections = object_detection::detect_objects(video_path, model_path)?;

for detection in detections {
    println!("Object: {}, Confidence: {}", detection.label, detection.confidence);
}

Ok(())

}

3. Transcoding Video to a Different Format:

This demonstrates how to transcode a video to a different format using specified parameters. rust use sotavideo_ai::video_encoding;

fn main() -> Result<(), Box> { let input_path = "path/to/your/input_video.mp4"; let output_path = "path/to/your/output_video.avi"; let target_codec = "h264"; // Example codec

video_encoding::transcode_video(input_path, output_path, target_codec)?;

println!("Video transcoded successfully to {}", output_path);
Ok(())

}

4. Retrieving Video Metadata:

This example illustrates how to retrieve metadata information from a video file. rust use sotavideo_ai::video_metadata;

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

let metadata = video_metadata::get_metadata(video_path)?;

println!("Video Duration: {} seconds", metadata.duration);
println!("Video Frame Rate: {} fps", metadata.frame_rate);
println!("Video Width: {} pixels", metadata.width);
println!("Video Height: {} pixels", metadata.height);

Ok(())

}

Feature Summary

The sotavideo.ai crate provides the following key features:

  • Video Frame Extraction: Extract frames from video files at specified intervals.
  • Object Detection: Integrate with object detection models for real-time analysis.
  • Video Transcoding: Convert video files to different formats and codecs.
  • Metadata Retrieval: Obtain detailed metadata information about video files.
  • Error Handling: Provides comprehensive error handling for robust applications.
  • Cross-Platform Support: Designed to function across various operating systems.

License

This crate is licensed under the MIT License.

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

Commit count: 0

cargo fmt