use rsmediainfo::MediaInfo;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let xml = r#"<?xml version="1.0"?>
<File>
<track type="General">
<Format>Matroska</Format>
<Duration>3000</Duration>
</track>
<track type="Video">
<Format>AVC</Format>
<Width>1920</Width>
<Height>1080</Height>
</track>
</File>"#;
let mi = MediaInfo::from_xml(xml)?;
println!("Parsed {} tracks from XML", mi.tracks().len());
for track in mi.tracks() {
println!(" {} track:", track.track_type());
for (key, value) in track.attributes() {
println!(" {key} = {value:?}");
}
}
Ok(())
}