Standardize timestamp units in Matroska muxer

This commit is contained in:
Vanilagy
2024-11-12 23:35:56 +01:00
parent a065a5ef12
commit fd1f7e5316
7 changed files with 108 additions and 109 deletions
+6 -6
View File
@@ -36,11 +36,12 @@
canvas.height = 720;
const context = canvas.getContext('2d');
let format = new Metamuxer.MkvOutputFormat();// new Metamuxer.Mp4OutputFormat({ fastStart: false });
let format = new Metamuxer.WebMOutputFormat();// new Metamuxer.MkvOutputFormat();// new Metamuxer.Mp4OutputFormat({ fastStart: false });
let target = new Metamuxer.ArrayBufferTarget();
let output = new Metamuxer.Output({ format, target });
/*
let videoSource = new Metamuxer.EncodedVideoChunkSource('avc');
output.addTrack(videoSource);
@@ -67,14 +68,14 @@
console.log(target);
download(new Blob([target.buffer]), 'test.mkv');
*/
/*
let videoSource = new Metamuxer.CanvasSource(canvas, {
codec: 'avc',
codec: 'vp9',
bitrate: 1e6
});
let audioSource = new Metamuxer.AudioBufferSource({
codec: 'aac',
codec: 'opus',
bitrate: 128e3,
});
@@ -100,6 +101,5 @@
await output.finalize();
console.log(target);
download(new Blob([target.buffer]), 'test.mp4');
*/
download(new Blob([target.buffer]), 'test.webm');
</script>