@mediabunny/server 1.61.5 → 1.62.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mediabunny/server",
3
3
  "author": "Vanilagy",
4
- "version": "1.61.5",
4
+ "version": "1.62.0",
5
5
  "description": "Adds full video and audio decoder and encoder support to Mediabunny for use in server-side environments (Node, Bun, Deno). Based on NodeAV.",
6
6
  "main": "./dist/bundles/mediabunny-server.cjs",
7
7
  "module": "./dist/bundles/mediabunny-server.mjs",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "node-av": "^6.0.0",
38
- "@mediabunny/prores": "^1.61.5"
38
+ "@mediabunny/prores": "^1.62.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "mediabunny": "^1.45.0"
@@ -403,6 +403,12 @@ export class NodeAvVideoEncoder extends CustomVideoEncoder {
403
403
  this.dstFrame.colorSpace = this.codecContext.colorSpace;
404
404
  this.dstFrame.colorRange = this.codecContext.colorRange;
405
405
 
406
+ // Primaries and transfer only ever differ due to retagging (e.g. sRGB as BT.709), so mirror them onto the
407
+ // source. Otherwise, swscale would do a real (and slow) transfer conversion instead of just the matrix.
408
+ // See https://github.com/Vanilagy/mediabunny/issues/572
409
+ this.frame.colorPrimaries = this.codecContext.colorPrimaries;
410
+ this.frame.colorTrc = this.codecContext.colorTrc;
411
+
406
412
  const ret = await this.scaler.scaleFrame(this.dstFrame, this.frame);
407
413
  NodeAv.FFmpegError.throwIfError(ret, 'Scale frame');
408
414