Adjust timestamp logic for media sinks for more accurate audio timing

This commit is contained in:
Vanilagy
2025-01-12 16:41:42 +01:00
parent 764a6dfd52
commit aea808ca0c
6 changed files with 91 additions and 37 deletions
+2 -2
View File
@@ -38,7 +38,7 @@
canvas.height = 720;
const context = canvas.getContext('2d');
let format = new Metamuxer.WebMOutputFormat({ streamable: false });
let format = new Metamuxer.MkvOutputFormat({ streamable: false });
//format = new Metamuxer.Mp4OutputFormat({ fastStart: 'fragmented' }); // new Metamuxer.MkvOutputFormat();// new Metamuxer.Mp4OutputFormat({ fastStart: false });
let target = new Metamuxer.BufferTarget();
@@ -88,7 +88,7 @@
bitrate: 1e6
});
let audioSource = new Metamuxer.AudioBufferSource({
codec: 'opus',
codec: 'pcm-s16',
bitrate: 128e3,
});
let subtitleSource = new Metamuxer.TextSubtitleSource('webvtt');
+1 -1
View File
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<input type="file" accept="video/mp4,video/quicktime,audio/x-m4a,video/x-m4v,audio/wav,video/webm">
<input type="file">
<div id="player"
style="display: none; flex-direction: column; align-items: center;