Skip to content

Commit

Permalink
fix tests and update mp4copy example.
Browse files Browse the repository at this point in the history
  • Loading branch information
alfg committed Sep 2, 2020
1 parent 042629a commit 3b5a728
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion examples/mp4copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::io::prelude::*;
use std::io::{self, BufReader, BufWriter};
use std::path::Path;

use mp4::{AacConfig, AvcConfig, MediaConfig, MediaType, Mp4Config, Result, TrackConfig};
use mp4::{AacConfig, AvcConfig, HevcConfig, MediaConfig, MediaType, Mp4Config, Result, TrackConfig};

fn main() {
let args: Vec<String> = env::args().collect();
Expand Down Expand Up @@ -48,6 +48,10 @@ fn copy<P: AsRef<Path>>(src_filename: &P, dst_filename: &P) -> Result<()> {
seq_param_set: track.sequence_parameter_set()?.to_vec(),
pic_param_set: track.picture_parameter_set()?.to_vec(),
}),
MediaType::H265 => MediaConfig::HevcConfig(HevcConfig {
width: track.width(),
height: track.height(),
}),
MediaType::AAC => MediaConfig::AacConfig(AacConfig {
bitrate: track.bitrate(),
profile: track.audio_profile()?,
Expand Down
2 changes: 1 addition & 1 deletion src/mp4box/hev1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl Mp4Box for HvcCBox {
}

fn box_size(&self) -> u64 {
let size = HEADER_SIZE + 7;
let size = HEADER_SIZE + 1;
size
}
}
Expand Down

0 comments on commit 3b5a728

Please sign in to comment.