mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 19:03:46 +02:00
MPEG-TS demuxer optimizations: faster Annex B segmentation, better NALU iteration
This commit is contained in:
+5
-8
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user