Add setting track language code, add proper AV1 CodecPrivate for Matroska muxer

This commit is contained in:
Vanilagy
2025-01-15 20:00:29 +01:00
parent 9af3e6eb66
commit 2bec661985
7 changed files with 120 additions and 59 deletions
+3 -3
View File
@@ -39,7 +39,7 @@
const context = canvas.getContext('2d');
let format = new Metamuxer.MkvOutputFormat({ streamable: false });
//format = new Metamuxer.Mp4OutputFormat({ fastStart: 'fragmented' }); // new Metamuxer.MkvOutputFormat();// new Metamuxer.Mp4OutputFormat({ fastStart: false });
format = new Metamuxer.Mp4OutputFormat({ fastStart: 'fragmented' }); // new Metamuxer.MkvOutputFormat();// new Metamuxer.Mp4OutputFormat({ fastStart: false });
let target = new Metamuxer.BufferTarget();
/*
@@ -88,12 +88,12 @@
bitrate: 1e6
});
let audioSource = new Metamuxer.AudioBufferSource({
codec: 'pcm-s16',
codec: 'opus',
bitrate: 128e3,
});
let subtitleSource = new Metamuxer.TextSubtitleSource('webvtt');
output.addVideoTrack(videoSource);
output.addVideoTrack(videoSource, { languageCode: 'eng' });
output.addAudioTrack(audioSource);
output.addSubtitleTrack(subtitleSource);