mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 02:43:48 +02:00
Replace ArrayBufferTarget with BufferTarget, now spitting out Uint8Array and using .resize
This commit is contained in:
+3
-3
@@ -44,7 +44,7 @@
|
||||
//console.log(await videoTrack.computeSampleStats());
|
||||
//return;
|
||||
|
||||
const target = new Metamuxer.ArrayBufferTarget();
|
||||
const target = new Metamuxer.BufferTarget();
|
||||
const output = new Metamuxer.Output({
|
||||
format: new Metamuxer.MovOutputFormat({ fastStart: undefined }),
|
||||
target
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
const decoderConfig = await audioTrack.getDecoderConfig();
|
||||
const sampleSource = new Metamuxer.EncodedAudioSampleSource(await audioTrack.getCodec());
|
||||
const audioDataSource = new Metamuxer.AudioDataSource({ codec: 'ulaw' });
|
||||
const audioDataSource = new Metamuxer.AudioDataSource({ codec: 'aac', bitrate: 128e3 });
|
||||
const videoSampleSource = new Metamuxer.EncodedVideoSampleSource(await videoTrack.getCodec());
|
||||
output.addAudioTrack(audioDataSource ?? sampleSource);
|
||||
output.addVideoTrack(videoSampleSource);
|
||||
@@ -94,7 +94,7 @@
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
download(new Blob([target.buffer]), 'converted.mov');
|
||||
//download(new Blob([target.buffer]), 'converted.mov');
|
||||
|
||||
document.body.textContent = performance.now() - start;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user