Probe encoder support with sample (fixes #90), improve encoder error handling

This commit is contained in:
Vanilagy
2025-09-04 11:11:04 +02:00
parent 68a6202269
commit 4860a4bfe7
3 changed files with 64 additions and 23 deletions
+6 -7
View File
@@ -18,15 +18,13 @@
const file = fileInput.files[0];
const source = new Mediabunny.BlobSource(file);
const target = new Mediabunny.NullTarget() ?? new Mediabunny.BufferTarget() ?? new Mediabunny.StreamTarget(new WritableStream({
const target = new Mediabunny.BufferTarget() ?? new Mediabunny.StreamTarget(new WritableStream({
write: console.log
}), {
chunked: true,
chunkSize: 2**20
});
const outputFormat = new Mediabunny.Mp4OutputFormat({
onMoov: console.log
});
const outputFormat = new Mediabunny.Mp4OutputFormat({});
const button = document.createElement('button');
button.textContent = 'Cancel';
@@ -76,7 +74,8 @@
},
*/
video: () => ({
//codec: 'avc',
forceTranscode: true,
codec: 'avc',
//fit: 'contain',
//frameRate: 27.123,
//width: 320,
@@ -98,8 +97,8 @@
//height: 100,
}),
trim: {
//start: 0,
//end: 20
start: 0,
end: 5
},
});
console.log(conversion);