Ensure rotation is always clockwise, make CanvasSink more powerful, disable rotation metadata for Matroska outputs, & other changes

This commit is contained in:
Vanilagy
2025-03-02 11:59:11 +01:00
parent 2ab385b16e
commit 453f8b6884
15 changed files with 304 additions and 200 deletions
+19 -3
View File
@@ -16,7 +16,7 @@
const source = new Metamuxer.BlobSource(file);
const target = new Metamuxer.BufferTarget();
const outputFormat = new Metamuxer.Mp4OutputFormat()
const outputFormat = new Metamuxer.WebMOutputFormat()
const abortController = new AbortController();
const button = document.createElement('button');
@@ -62,7 +62,16 @@
},
*/
video: {
//forceReencode: true
//forceReencode: true,
//rotate: 90
//width: 720 ?? 2160,
//height: 1280 ?? 3840,
fit: 'contain',
rotate: 90,
width: 512,
height: 512,
//width: 200,
//height: 100,
},
trim: {
start: 0,
@@ -77,7 +86,14 @@
console.log(res)
console.log("Done", target.buffer);
download(new Blob([target.buffer]), 'converted' + outputFormat.getFileExtension());
const video = document.createElement('video');
video.src = URL.createObjectURL(new Blob([target.buffer]));
video.controls = true;
document.body.append(video);
video.play();
//download(new Blob([target.buffer]), 'converted' + outputFormat.fileExtension);
function download(blob, filename) {
const url = URL.createObjectURL(blob);