From e879500c1add6d006294576fb1f7638f6c0962ee Mon Sep 17 00:00:00 2001 From: Alf Date: Sat, 5 Sep 2020 13:15:31 -0700 Subject: [PATCH] update mp4info example and track. --- examples/mp4info.rs | 2 +- src/track.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/mp4info.rs b/examples/mp4info.rs index 69bb3d6..a263777 100644 --- a/examples/mp4info.rs +++ b/examples/mp4info.rs @@ -130,7 +130,7 @@ fn subtitle_info(track: &Mp4Track) -> Result { track.box_type()?, )) } else { - Ok("subtitle test".to_string()) + Err(Error::InvalidData("tx3g box not found")) } } diff --git a/src/track.rs b/src/track.rs index 8e65def..4644533 100644 --- a/src/track.rs +++ b/src/track.rs @@ -17,6 +17,7 @@ use crate::mp4box::{ stsc::StscEntry, stss::StssBox, stts::SttsEntry, + tx3g::Tx3gBox, vmhd::VmhdBox, }; use crate::*; @@ -509,7 +510,10 @@ impl Mp4TrackWriter { let mp4a = Mp4aBox::new(aac_config); trak.mdia.minf.stbl.stsd.mp4a = Some(mp4a); } - MediaConfig::TtxtConfig(ref _ttxt_config) => {} + MediaConfig::TtxtConfig(ref _ttxt_config) => { + let tx3g = Tx3gBox::default(); + trak.mdia.minf.stbl.stsd.tx3g = Some(tx3g); + } } Ok(Mp4TrackWriter { trak,