Allow object for tags field in conversion

This commit is contained in:
Vanilagy
2025-09-16 15:10:16 +02:00
parent 7efb092ff5
commit fcec67645a
4 changed files with 55 additions and 47 deletions
+27 -27
View File
@@ -47,23 +47,6 @@
format: outputFormat,
target
});
output.setMetadataTags({
title: 'Bigggy',
artist: 'Buck Bunny',
images: [{
data: blobData,
kind: 'coverFront',
mimeType: 'image/jpeg'
}],
trackNumber: 4,
tracksTotal: 10,
discNumber: 5,
discNumberMax: 8,
lyrics: "There's no way\nThat it's not going there",
raw: {
'ENCODER': 'Mediabunny epic own encoder'
}
});
const conversion = await Mediabunny.Conversion.init({
input: new Mediabunny.Input({
@@ -109,16 +92,16 @@
*/
video: () => ({
//discard: true,
crop: {
left: 0,
top: 0,
width: 500,
height: 500,
},
rotate: 90,
width: 200,
height: 500,
fit: 'contain',
//crop: {
// left: 0,
// top: 0,
// width: 500,
// height: 500,
//},
//rotate: 90,
//width: 200,
//height: 500,
//fit: 'contain',
//forceTranscode: true,
//codec: 'avc',
//fit: 'contain',
@@ -141,6 +124,23 @@
//width: 200,
//height: 100,
}),
tags: {
title: 'Bigggy',
artist: 'Buck Bunny',
images: [{
data: blobData,
kind: 'coverFront',
mimeType: 'image/jpeg'
}],
trackNumber: 4,
tracksTotal: 10,
discNumber: 5,
discsTotal: 8,
lyrics: "There's no way\nThat it's not going there",
raw: {
'AIGC': 'Mediabunny epic own encoder'
}
},
trim: {
start: 10,
end: 20
+1 -6
View File
@@ -14,12 +14,7 @@
source: new Mediabunny.BlobSource(file),
});
const audioTrack = await input.getPrimaryAudioTrack();
const sink = new Mediabunny.EncodedPacketSink(audioTrack);
for await (const packet of sink.packets()) {
console.log(packet);
}
console.log(await input.getMetadataTags())
/*
const sink = new Mediabunny.EncodedPacketSink(videoTrack);