| Crates.io | veo |
| lib.rs | veo |
| version | 67.0.28 |
| created_at | 2025-12-31 09:07:08.114764+00 |
| updated_at | 2025-12-31 09:07:08.114764+00 |
| description | High-quality integration for https://supermaker.ai/video/veo/ |
| homepage | https://supermaker.ai/video/veo/ |
| repository | https://github.com/qy-upup/veo |
| max_upload_size | |
| id | 2014313 |
| size | 14,955 |
veo is a Rust crate designed for efficient and reliable video processing and manipulation tasks. It provides a set of tools for encoding, decoding, and transforming video data within Rust applications.
To integrate veo into your project, add the following line to your Cargo.toml file under the [dependencies] section:
toml
veo = "0.1.0" # Replace with the latest version
Here are a few examples demonstrating how to use veo for common video processing tasks:
1. Basic Video Encoding:
This example demonstrates encoding a sequence of images into a video file. rust use veo::encoder::Encoder; use veo::format::VideoFormat;
fn main() -> Result<(), Box
// Assuming you have image data in `image_data` (e.g., Vec<u8>)
// and image dimensions are 1280x720
// Simulate adding frames (replace with actual image data)
for frame_number in 0..100 {
let image_data = vec![0u8; 1280 * 720 * 3]; // Placeholder for image data
encoder.encode_frame(&image_data)?;
}
encoder.finish()?;
println!("Video encoding complete!");
Ok(())
}
2. Video Decoding and Frame Extraction:
This example demonstrates decoding a video file and extracting individual frames. rust use veo::decoder::Decoder; use std::fs::File; use std::io::BufReader;
fn main() -> Result<(), Box
while let Some(frame) = decoder.decode_frame()? {
// Process the frame data (e.g., save it as an image)
// frame is a Vec<u8> containing the raw pixel data
println!("Decoded frame with size: {}", frame.len());
// Implement your frame processing logic here
}
println!("Video decoding complete!");
Ok(())
}
3. Resizing a Video:
This example illustrates how to resize video frames during encoding. (Note: resizing functionality might require additional feature flags or helper functions, depending on the crate's specific implementation. The example shows the intended usage.) rust use veo::encoder::Encoder; use veo::format::VideoFormat; // Assuming you have a resize function or module. // use veo::resize; // Uncomment if a resize module exists
fn main() -> Result<(), Box
// Simulate adding frames (replace with actual image data and resizing)
for frame_number in 0..100 {
let original_image_data = vec![0u8; 1280 * 720 * 3]; // Placeholder for original image data
// Assuming `resize::resize_frame` is a function that resizes the frame
// let resized_image_data = resize::resize_frame(&original_image_data, 1280, 720, 640, 480)?;
let resized_image_data = vec![0u8; 640 * 480 * 3]; // Placeholder for resized image data
encoder.encode_frame(&resized_image_data)?;
}
encoder.finish()?;
println!("Video encoding with resizing complete!");
Ok(())
}
4. Changing Frame Rate:
This example shows how to adjust the frame rate of a video during encoding. (Note: This functionality might require specific encoder settings.) rust use veo::encoder::Encoder; use veo::format::VideoFormat;
fn main() -> Result<(), Box
// Simulate adding frames (replace with actual image data)
for frame_number in 0..50 { // Fewer frames to keep video length similar
let image_data = vec![0u8; 1280 * 720 * 3]; // Placeholder for image data
encoder.encode_frame(&image_data)?;
}
encoder.finish()?;
println!("Video encoding with modified frame rate complete!");
Ok(())
}
veo offers the following key features:
MIT
This crate is part of the veo ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/video/veo/