major brand修改为`isml`

This commit is contained in:
nilaoda 2022-11-29 15:46:47 +08:00
parent 8905b1e88c
commit b3cf21df5d
1 changed files with 22 additions and 3 deletions

View File

@ -244,10 +244,11 @@ namespace N_m3u8DL_RE.Parser.Mp4
using var stream = new MemoryStream(); using var stream = new MemoryStream();
using var writer = new BinaryWriter2(stream); using var writer = new BinaryWriter2(stream);
writer.Write("iso6"); //major brand writer.Write("isml"); //major brand
writer.WriteUInt(1); //minor version writer.WriteUInt(1); //minor version
writer.Write("isom"); //compatible brand
writer.Write("iso5"); //compatible brand writer.Write("iso5"); //compatible brand
writer.Write("iso6"); //compatible brand
writer.Write("piff"); //compatible brand
writer.Write("msdh"); //compatible brand writer.Write("msdh"); //compatible brand
return Box("ftyp", stream.ToArray()); return Box("ftyp", stream.ToArray());
@ -762,6 +763,22 @@ namespace N_m3u8DL_RE.Parser.Mp4
return psshBox; return psshBox;
} }
private byte[] GenMoof()
{
using var stream = new MemoryStream();
using var writer = new BinaryWriter2(stream);
//make senc
writer.WriteUInt(1); //sample_count
writer.Write(new byte[8]); //8 bytes IV
var sencBox = FullBox("senc", 1, 0, stream.ToArray());
var moofBox = Box("moof", sencBox); //Movie Extends Box
return moofBox;
}
public byte[] GenHeader(byte[] firstSegment) public byte[] GenHeader(byte[] firstSegment)
{ {
new MP4Parser() new MP4Parser()
@ -842,9 +859,11 @@ namespace N_m3u8DL_RE.Parser.Mp4
var moovBox = Box("moov", moovPayload); //Movie Box var moovBox = Box("moov", moovPayload); //Movie Box
stream.Write(moovBox); stream.Write(moovBox);
//var moofBox = GenMoof(); //Movie Extends Box
//stream.Write(moofBox);
return stream.ToArray(); return stream.ToArray();
} }
} }