MPEG-TS demuxer optimizations: faster Annex B segmentation, better NALU iteration

This commit is contained in:
Vanilagy
2026-01-16 13:26:58 +01:00
parent e3ee9d91a9
commit ae37973878
7 changed files with 267 additions and 238 deletions
+5 -8
View File
@@ -11,17 +11,14 @@
const file = fileInput.files[0];
const input = new Mediabunny.Input({
formats: Mediabunny.ALL_FORMATS,
source: new Mediabunny.BlobSource(file),
source: new Mediabunny.BufferSource(await file.arrayBuffer()),
});
const track = await input.getPrimaryVideoTrack();
const track = await input.getPrimaryAudioTrack();
const sink = new Mediabunny.EncodedPacketSink(track);
let currentPacket = await sink.getFirstPacket();
while (currentPacket) {
console.log(currentPacket);
currentPacket = await sink.getNextPacket(currentPacket);
}
console.log("Done")
/*
//const secondPacket = await sink.getNextPacket(firstPacket);