mirror of
https://github.com/alfg/mp4-rust.git
synced 2025-02-21 23:46:16 +00:00
update mp4info and mp4dump examples.
This commit is contained in:
parent
b4b4dbd49f
commit
042629a88c
2 changed files with 25 additions and 10 deletions
|
@ -85,6 +85,9 @@ fn get_boxes(file: File) -> Result<Vec<Box>> {
|
|||
if let Some(ref avc1) = &stbl.stsd.avc1 {
|
||||
boxes.push(build_box(avc1));
|
||||
}
|
||||
if let Some(ref hev1) = &stbl.stsd.hev1 {
|
||||
boxes.push(build_box(hev1));
|
||||
}
|
||||
if let Some(ref mp4a) = &stbl.stsd.mp4a {
|
||||
boxes.push(build_box(mp4a));
|
||||
}
|
||||
|
|
|
@ -61,16 +61,28 @@ fn info<P: AsRef<Path>>(filename: &P) -> Result<()> {
|
|||
}
|
||||
|
||||
fn video_info(track: &Mp4Track) -> Result<String> {
|
||||
Ok(format!(
|
||||
"{} ({}) ({:?}), {}x{}, {} kb/s, {:.2} fps",
|
||||
track.media_type()?,
|
||||
track.video_profile()?,
|
||||
track.box_type()?,
|
||||
track.width(),
|
||||
track.height(),
|
||||
track.bitrate() / 1000,
|
||||
track.frame_rate_f64()
|
||||
))
|
||||
if track.trak.mdia.minf.stbl.stsd.avc1.is_some() {
|
||||
Ok(format!(
|
||||
"{} ({}) ({:?}), {}x{}, {} kb/s, {:.2} fps",
|
||||
track.media_type()?,
|
||||
track.video_profile()?,
|
||||
track.box_type()?,
|
||||
track.width(),
|
||||
track.height(),
|
||||
track.bitrate() / 1000,
|
||||
track.frame_rate_f64()
|
||||
))
|
||||
} else {
|
||||
Ok(format!(
|
||||
"{} ({:?}), {}x{}, {} kb/s, {:.2} fps",
|
||||
track.media_type()?,
|
||||
track.box_type()?,
|
||||
track.width(),
|
||||
track.height(),
|
||||
track.bitrate() / 1000,
|
||||
track.frame_rate_f64()
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn audio_info(track: &Mp4Track) -> Result<String> {
|
||||
|
|
Loading…
Reference in a new issue