mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 10:53:50 +02:00
Add Matroska muxer
This commit is contained in:
+4
-4
@@ -36,17 +36,17 @@
|
||||
canvas.height = 720;
|
||||
const context = canvas.getContext('2d');
|
||||
|
||||
let format = new Metamuxer.Mp4OutputFormat({ fastStart: false });
|
||||
let format = new Metamuxer.WebMOutputFormat(); //new Metamuxer.Mp4OutputFormat({ fastStart: false });
|
||||
let target = new Metamuxer.ArrayBufferTarget();
|
||||
|
||||
let output = new Metamuxer.Output({ format, target });
|
||||
|
||||
let videoSource = new Metamuxer.CanvasSource(canvas, {
|
||||
codec: 'vp8',
|
||||
codec: 'avc',
|
||||
bitrate: 1e6
|
||||
});
|
||||
let audioSource = new Metamuxer.AudioBufferSource({
|
||||
codec: 'aac',
|
||||
codec: 'opus',
|
||||
bitrate: 128e3,
|
||||
});
|
||||
|
||||
@@ -72,5 +72,5 @@
|
||||
await output.finalize();
|
||||
|
||||
console.log(target);
|
||||
download(new Blob([target.buffer]), 'test.mp4');
|
||||
download(new Blob([target.buffer]), 'test.webm');
|
||||
</script>
|
||||
Reference in New Issue
Block a user