3个版本
使用旧Rust 2015
0.1.2 | 2016年7月4日 |
---|---|
0.1.1 | 2016年7月4日 |
0.1.0 | 2016年7月2日 |
#424 in 视频
3MB
462 行
video-metadata-rs

此库提供了一些用于获取以下视频类型元数据的包装器
- WebM
- MP4
- Ogg
其他视频/文件类型将返回错误。
示例
extern crate video_metadata;
use video_metadata::enums;
fn main() {
match video_metadata::get_format("your_video_file") {
enums::Result::Complete(m) => {
println!("format: {:?}", m.format);
println!("duration: {:?}", m.duration);
println!("size: {}x{}", m.size.width, m.size.height);
println!("video codec: {}", m.video);
if let Some(audio) = m.audio {
println!("audio codec: {}", audio);
}
}
enums::Result::Unknown(s) => {
println!("Unknown format: '{}'", s);
}
};
}
警告
请注意,我正在使用以下库的版本3
- libavformat
- libavcodec
- libavutil
您可以在它们的存储库中找到更多信息。