This commit is contained in:
Vanilagy
2025-11-14 14:07:31 +01:00
parent abe6185ddd
commit 7fd2ec6373
11 changed files with 882 additions and 78 deletions
+57 -1
View File
@@ -14,7 +14,61 @@
source: new Mediabunny.BlobSource(file),
});
console.log(await input.getTracks());
const videoTrack = await input.getPrimaryVideoTrack();
const cursor = await Mediabunny.VideoSampleCursor2.init(videoTrack);
/*
console.log(await cursor.seekTo(2.00));
console.log(await cursor.next());
console.log(await cursor.next());
*/
const mh = [
cursor.seekTo(2.10),
cursor.seekTo(5),
//cursor.seekTo(2.00),
];
console.log(await Promise.all(mh));
//console.log(await cursor.seekTo(2.05));
//console.log(await cursor.seekTo(2.10));
//console.log(await cursor.seekTo(10.2));
//console.log(await cursor.seekTo(5.2));
/*
setTimeout(async () => {
console.log("this")
}, 500);
*/
/*
const iters = 5;
let total = 0;
for (let i = 0; i < iters; i++) {
const file = fileInput.files[0];
const input = new Mediabunny.Input({
formats: Mediabunny.ALL_FORMATS,
source: new Mediabunny.BufferSource(await file.arrayBuffer()),
});
const audioTrack = await input.getPrimaryAudioTrack();
const cursor = new Mediabunny.PacketCursor(audioTrack);
await cursor.seekToStart();
const start = performance.now();
await cursor.iterate(() => {});
//alert(performance.now() - start)
total += performance.now() - start;
}
alert(total / iters);
*/
/*
return;
@@ -95,6 +149,8 @@
total += end - start;
//console.log(total / file.size, end - start);
}
alert(elapsed / iters);
const videoTrack = await input.getPrimaryVideoTrack();
const sink = new Mediabunny.EncodedPacketSink(videoTrack);