mirror of
https://github.com/alfg/mp4-rust.git
synced 2024-12-22 12:06:33 +00:00
Update example in README.md.
This commit is contained in:
parent
0df82aec5f
commit
ba69f3812b
1 changed files with 6 additions and 5 deletions
11
README.md
11
README.md
|
@ -14,13 +14,14 @@ use mp4;
|
|||
|
||||
fn main() {
|
||||
let f = File::open("example.mp4").unwrap();
|
||||
let size = f.metadata()?.len();
|
||||
let reader = BufReader::new(f);
|
||||
|
||||
let bmff = mp4::read_mp4(f).unwrap();
|
||||
let mut mp4 = Mp4Reader::new(reader);
|
||||
mp4.read(size)?;
|
||||
|
||||
println!("file size: {}", bmff.size);
|
||||
println!("brands: {:?} {:?}\n",
|
||||
bmff.ftyp.major_brand, bmff.ftyp.compatible_brands
|
||||
);
|
||||
println!("size: {}", mp4.size());
|
||||
println!("brands: {:?} {:?}\n", mp4.ftyp.major_brand, mp4.ftyp.compatible_brands);
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue