public Mp4TkhdBox(DateTime creationTime, DateTime modificationTime, uint trackId, ulong duration, ushort volume, uint width, uint height) : base(0x68, Mp4BoxType.TKHD, 0L, 1, 7) { this.Reserved2 = new byte[8]; this.Matrix = new uint[9]; this.CreationTime = Mp4Util.ConvertTime(creationTime); this.ModificationTime = Mp4Util.ConvertTime(modificationTime); this.TrackId = trackId; this.Reserved1 = 0; this.Duration = duration; this.Layer = 0; this.AlternateGroup = 0; this.Volume = volume; this.Reserved3 = 0; this.Width = width; this.Height = height; this.Matrix[0] = 0x10000; this.Matrix[1] = 0; this.Matrix[2] = 0; this.Matrix[3] = 0; this.Matrix[4] = 0x10000; this.Matrix[5] = 0; this.Matrix[6] = 0; this.Matrix[7] = 0; this.Matrix[8] = 0x40000000; this.Reserved2[0] = 0; this.Reserved2[1] = 0; }
public Mp4MdhdBox(DateTime creationTime, DateTime modificationTime, uint timeScale, ulong duration, string language) : base(0x2c, Mp4BoxType.MDHD, 0L, 1, 0) { this.CreationTime = Mp4Util.ConvertTime(creationTime); this.ModificationTime = Mp4Util.ConvertTime(modificationTime); this.TimeScale = timeScale; this.Duration = duration; this.Language = language; if (language.Length != 3) { throw new Mp4Exception("Language must be of length 3."); } }
public Mp4MvhdBox(DateTime creationTime, DateTime modificationTime, uint timeScale, ulong duration, uint rate, ushort volume) : base(120, Mp4BoxType.MVHD, 0L, 1, 0) { this.Reserved1 = new byte[2]; this.Reserved2 = new byte[8]; this.Matrix = new uint[9]; this.Predefined = new byte[0x18]; this.CreationTime = Mp4Util.ConvertTime(creationTime); this.ModificationTime = Mp4Util.ConvertTime(modificationTime); this.TimeScale = timeScale; this.Duration = duration; this.Rate = rate; this.Volume = volume; this.NextTrackId = uint.MaxValue; this.Matrix[0] = 0x10000; this.Matrix[1] = 0; this.Matrix[2] = 0; this.Matrix[3] = 0; this.Matrix[4] = 0x10000; this.Matrix[5] = 0; this.Matrix[6] = 0; this.Matrix[7] = 0; this.Matrix[8] = 0x40000000; }