mediabunny 1.52.1 → 1.52.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -130,7 +130,7 @@ const { title, artist, album } = await input.getMetadataTags();
130
130
  ### Create new media files
131
131
 
132
132
  ```js
133
- import { Output, Mp4OutputFormat, BufferTarget, CanvasSource, QUALITY_HIGH } from 'mediabunny';
133
+ import { Output, Mp4OutputFormat, BufferTarget, CanvasSource, Quality } from 'mediabunny';
134
134
 
135
135
  const output = new Output({
136
136
  format: new Mp4OutputFormat(),
@@ -140,7 +140,7 @@ const output = new Output({
140
140
  // Add a video track backed by a canvas element
141
141
  const videoSource = new CanvasSource(canvas, {
142
142
  codec: 'avc',
143
- bitrate: QUALITY_HIGH,
143
+ bitrate: new Quality('high'),
144
144
  });
145
145
  output.addVideoTrack(videoSource);
146
146
 
@@ -20265,6 +20265,7 @@ var Mediabunny = (() => {
20265
20265
  "The '2d' canvas context is required to transform VideoSamples. Register a custom transformer using registerVideoSampleTransformer to work around this limitation."
20266
20266
  );
20267
20267
  }
20268
+ context.imageSmoothingQuality = "high";
20268
20269
  if (description.alpha === "discard") {
20269
20270
  context.fillStyle = "black";
20270
20271
  context.fillRect(0, 0, description.width, description.height);
@@ -23520,7 +23521,7 @@ var Mediabunny = (() => {
23520
23521
  // Firefox has VideoFrame glitches with opaque canvases
23521
23522
  });
23522
23523
  assert(context);
23523
- context.resetTransform();
23524
+ context.imageSmoothingQuality = "high";
23524
23525
  if (!canvasIsNew) {
23525
23526
  if (!this._alpha && isFirefox()) {
23526
23527
  context.fillStyle = "black";
@@ -27191,6 +27192,7 @@ var Mediabunny = (() => {
27191
27192
  if (trackData.track.metadata.disposition?.default !== false) {
27192
27193
  flags |= 1;
27193
27194
  }
27195
+ const alternateGroup = trackData.type === "video" ? 0 : trackData.type === "audio" ? 1 : trackData.type === "subtitle" ? 2 : assertNever(trackData);
27194
27196
  return fullBox("tkhd", +needsU64, flags, [
27195
27197
  u32OrU64(creationTime),
27196
27198
  // Creation time
@@ -27206,7 +27208,7 @@ var Mediabunny = (() => {
27206
27208
  // Reserved
27207
27209
  u16(0),
27208
27210
  // Layer
27209
- u16(trackData.track.id),
27211
+ u16(alternateGroup),
27210
27212
  // Alternate group
27211
27213
  fixed_8_8(trackData.type === "audio" ? 1 : 0),
27212
27214
  // Volume
@@ -37062,13 +37064,13 @@ ${cue.notes ?? ""}`;
37062
37064
  }
37063
37065
  return this._startPromise = (async () => {
37064
37066
  this.state = "started";
37065
- const release = await this._mutex.acquire();
37067
+ const releasePromise = this._mutex.acquire();
37066
37068
  try {
37067
37069
  await this._muxer.start();
37068
37070
  const promises = this.tracks.map((track) => track.source._start());
37069
37071
  await Promise.all(promises);
37070
37072
  } finally {
37071
- release();
37073
+ (await releasePromise)();
37072
37074
  }
37073
37075
  })();
37074
37076
  }