1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2025-04-15 08:14:15 +00:00
This commit is contained in:
damitha 2025-03-26 15:23:25 +11:00
parent 0e70b58892
commit caf699fce8
3 changed files with 11 additions and 14 deletions

View file

@ -70,7 +70,7 @@ fn copy<P: AsRef<Path>>(src_filename: &P, dst_filename: &P) -> Result<()> {
temporal_id_nested: Some(false),
length_size_minus_one: Some(3),
arrays: Some(vec![]),
box_type: Some(HevcBoxType::Hev1),
use_hvc1: true,
}),
MediaType::VP9 => MediaConfig::Vp9Config(Vp9Config {
width: track.width(),

View file

@ -791,15 +791,12 @@ impl Mp4TrackWriter {
let vmhd = VmhdBox::default();
trak.mdia.minf.vmhd = Some(vmhd);
match hevc_config.box_type.unwrap_or(HevcBoxType::Hev1) {
HevcBoxType::Hev1 => {
let hev1 = Hev1Box::new(hevc_config);
trak.mdia.minf.stbl.stsd.hev1 = Some(hev1);
}
HevcBoxType::Hvc1 => {
let hvc1 = Hvc1Box::new(hevc_config);
trak.mdia.minf.stbl.stsd.hvc1 = Some(hvc1);
}
if hevc_config.use_hvc1 {
let hvc1 = Hvc1Box::new(hevc_config);
trak.mdia.minf.stbl.stsd.hvc1 = Some(hvc1);
} else {
let hev1 = Hev1Box::new(hevc_config);
trak.mdia.minf.stbl.stsd.hev1 = Some(hev1);
}
}
MediaConfig::Vp9Config(ref config) => {

View file

@ -639,7 +639,7 @@ pub struct HevcConfig {
pub temporal_id_nested: Option<bool>,
pub length_size_minus_one: Option<u8>,
pub arrays: Option<Vec<HvcCArray>>,
pub box_type: Option<HevcBoxType>,
pub use_hvc1: bool,
}
impl Default for HevcConfig {
@ -665,7 +665,7 @@ impl Default for HevcConfig {
temporal_id_nested: None,
length_size_minus_one: None,
arrays: None,
box_type: None,
use_hvc1: false,
}
}
}
@ -691,8 +691,8 @@ impl HevcConfig {
self
}
pub fn with_box_type(mut self, box_type: HevcBoxType) -> Self {
self.box_type = Some(box_type);
pub fn with_use_hvc1(mut self, use_hvc1: bool) -> Self {
self.use_hvc1 = use_hvc1;
self
}