2020-08-25 05:38:05 +00:00
|
|
|
use mp4;
|
|
|
|
use std::env;
|
|
|
|
use std::fs::File;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let args: Vec<String> = env::args().collect();
|
|
|
|
|
|
|
|
if args.len() < 2 {
|
2020-08-27 03:45:18 +00:00
|
|
|
println!("Usage: simple <filename>");
|
2020-08-25 05:38:05 +00:00
|
|
|
std::process::exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
let filename = &args[1];
|
|
|
|
let f = File::open(filename).unwrap();
|
|
|
|
let mp4 = mp4::read_mp4(f).unwrap();
|
|
|
|
|
|
|
|
println!("Major Brand: {}", mp4.major_brand());
|
|
|
|
|
|
|
|
for track in mp4.tracks().iter() {
|
|
|
|
println!("Track: #{}({}) {} {}",
|
|
|
|
track.track_id(),
|
|
|
|
track.language(),
|
|
|
|
track.track_type().unwrap(),
|
|
|
|
track.box_type().unwrap(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|