Allow fractional frame rates in track metadata, document frameRate better, other small doc adjustments

This commit is contained in:
Vanilagy
2025-04-28 15:48:51 +02:00
parent cf19e0dcf1
commit e527fe1484
10 changed files with 113 additions and 41 deletions
+21 -21
View File
@@ -45,11 +45,11 @@
a.download = filename;
a.click();
URL.revokeObjectURL(url);
}
}
console.log(output.target.buffer)
download(new Blob([output.target.buffer]), 'converted.mp3');
download(new Blob([output.target.buffer]), 'converted.mp3');
/*
const videoTrack = await input.getPrimaryVideoTrack();
@@ -184,7 +184,7 @@
}
*/
/*
const videoTrack = await input.getPrimaryVideoTrack();
@@ -245,7 +245,7 @@
*/
//chunks.return();
//console.log("Done")
/*
@@ -441,31 +441,31 @@
const drain = new Metamuxer.VideoFrameDrain(videoTrack);
for await (const frame of drain.frames()) {
// ...
}
// ...
}
console.log(await videoTrack.getDuration());
*/
/*
const drain = new Metamuxer.VideoFrameDrain(videoTrack);
const drain = new Metamuxer.VideoFrameDrain(videoTrack);
const width = await videoTrack.getWidth();
const height = await videoTrack.getHeight();
const width = await videoTrack.getWidth();
const height = await videoTrack.getHeight();
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
document.body.append(canvas);
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
document.body.append(canvas);
const context = canvas.getContext('2d');
const context = canvas.getContext('2d');
// Top-level for await loop inside the event listener
for await (const frame of drain.frames()) {
context.drawImage(frame, 0, 0, width, height);
frame.close();
}
// Top-level for await loop inside the event listener
for await (const frame of drain.frames()) {
context.drawImage(frame, 0, 0, width, height);
frame.close();
}
*/
/*
+3 -3
View File
@@ -111,7 +111,7 @@
Example entry 1: Hello <b>world</b>.
`;
if (false) simpleWebvttFile =
if (false) simpleWebvttFile =
`WEBVTT
1
@@ -127,7 +127,7 @@ We are looking straight down 5th Avenue.
Testing... <00:17.350>One... <00:18.125>Two...
`
simpleWebvttFile =
simpleWebvttFile =
`WEBVTT
00:00:01.000 --> 00:00:01.500 align:start line:1
@@ -178,5 +178,5 @@ Testing... <00:17.350>One... <00:18.125>Two...
await output.finalize();
console.log(target);
download(new Blob([target.buffer]), 'test' + format.fileExtension);
//download(new Blob([target.buffer]), 'test' + format.fileExtension);
</script>