@napi-rs/webcodecs 1.2.0 → 1.2.1

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.
Files changed (4) hide show
  1. package/README.md +50 -18
  2. package/index.d.ts +16 -3
  3. package/index.js +52 -52
  4. package/package.json +11 -11
package/README.md CHANGED
@@ -7,7 +7,8 @@ WebCodecs API implementation for Node.js using FFmpeg, built with [NAPI-RS](http
7
7
  ## Features
8
8
 
9
9
  - **W3C WebCodecs API compliant** - Full implementation of the WebCodecs specification with native `DOMException` errors
10
- - **Video encoding/decoding** - H.264, H.265, VP8, VP9, AV1
10
+ - **Video encoding/decoding** - H.264, H.265, VP8, VP9 (with Alpha), AV1
11
+ - **Encoding Alpha channel** - VP9 encoding/decoding with Alpha support(See [canvas-to-video.js](example/canvas-to-video.js) example and [video.html](example/video.html))
11
12
  - **Audio encoding/decoding** - AAC, Opus, MP3, FLAC, Vorbis, PCM variants
12
13
  - **Container muxing/demuxing** - MP4, WebM, MKV containers with seeking support
13
14
  - **Image decoding** - JPEG, PNG, WebP, GIF, BMP, AVIF, JPEG XL
@@ -339,15 +340,21 @@ frame.close()
339
340
 
340
341
  ### Video
341
342
 
342
- | Codec | Codec String | Encoding | Decoding |
343
- | ----- | ----------------------- | -------- | -------- |
344
- | H.264 | `avc1.*` | ✅ | ✅ |
345
- | H.265 | `hev1.*`, `hvc1.*` | ✅ | ✅ |
346
- | VP8 | `vp8` | ✅ | ✅ |
347
- | VP9 | `vp09.*`, `vp9` | ✅ | ✅ |
348
- | AV1 | `av01.*`, `av01`, `av1` | ✅ | ✅ |
343
+ | Codec | Codec String | Encoding | Encoding Alpha | Decoding | Decoding Alpha |
344
+ | ----- | ----------------------- | -------- | -------------- | -------- | -------------- |
345
+ | H.264 | `avc1.*` | ✅ | 🙅🏻‍♀️ | ✅ | 🙅🏻‍♀️ |
346
+ | H.265 | `hev1.*`, `hvc1.*` | ✅ | ❓ | ✅ | ❓ |
347
+ | VP8 | `vp8` | ✅ | 🙅🏻‍♀️ | ✅ | 🙅🏻‍♀️ |
348
+ | VP9 | `vp09.*`, `vp9` | ✅ | ✅ | ✅ | ✅ |
349
+ | AV1 | `av01.*`, `av01`, `av1` | ✅ | 🙅🏻‍♀️ | ✅ | 🙅🏻‍♀️ |
349
350
 
350
- **Note:** Short form codec strings (`vp9`, `av01`, `av1`) are accepted for compatibility with browser implementations.
351
+ **Note:** Short form codec strings (`vp9`, `av01`, `av1`) are accepted for compatibility with browser implementations. VP9 encoding and decoding now supports Alpha channel (transparency).
352
+
353
+ **Legend:**
354
+
355
+ - ✅ Feature supported
356
+ - 🙅🏻‍♀️ Feature not supported by codec format
357
+ - ❓ Feature supported by codec format but not yet implemented
351
358
 
352
359
  ### Audio
353
360
 
@@ -362,15 +369,15 @@ frame.close()
362
369
 
363
370
  ### Image
364
371
 
365
- | Format | MIME Type | Decoding | Notes |
366
- | ------- | ------------ | -------- | ------------------------------ |
367
- | JPEG | `image/jpeg` | ✅ | |
368
- | PNG | `image/png` | ✅ | |
369
- | WebP | `image/webp` | ✅ | |
370
- | GIF | `image/gif` | ✅ | |
371
- | BMP | `image/bmp` | ✅ | |
372
- | AVIF | `image/avif` | ✅ | |
373
- | JPEG XL | `image/jxl` | ✅ | Not available on Windows arm64 |
372
+ | Format | MIME Type | Decoding |
373
+ | ------- | ------------ | -------- |
374
+ | JPEG | `image/jpeg` | ✅ |
375
+ | PNG | `image/png` | ✅ |
376
+ | WebP | `image/webp` | ✅ |
377
+ | GIF | `image/gif` | ✅ |
378
+ | BMP | `image/bmp` | ✅ |
379
+ | AVIF | `image/avif` | ✅ |
380
+ | JPEG XL | `image/jxl` | ✅ |
374
381
 
375
382
  ### Containers
376
383
 
@@ -533,6 +540,31 @@ ImageDecoder supports all W3C spec options:
533
540
 
534
541
  - **ImageDecoder GIF animation**: FFmpeg may return only the first frame. Use `VideoDecoder` with GIF codec for full animation.
535
542
 
543
+ ### Per-Frame Quantizer Control
544
+
545
+ Per-frame quantizer control is available for VP9 and AV1 when using `bitrateMode: 'quantizer'`:
546
+
547
+ ```typescript
548
+ encoder.configure({
549
+ codec: 'vp09.00.10.08',
550
+ width: 1920,
551
+ height: 1080,
552
+ bitrateMode: 'quantizer',
553
+ })
554
+
555
+ // Per-frame QP control (0-255 range per W3C WebCodecs spec)
556
+ encoder.encode(frame, { vp9: { quantizer: 128 } })
557
+ ```
558
+
559
+ | Codec | Per-Frame QP | Notes |
560
+ | ----- | ------------ | ------------------------------------------------------------ |
561
+ | VP9 | ✅ Works | Uses FFmpeg's dynamic qmax update mechanism |
562
+ | AV1 | ❌ No effect | FFmpeg's libaom wrapper doesn't support dynamic qmax updates |
563
+ | H.264 | ✅ Works | Uses FFmpeg's frame quality mechanism (0-51 range) |
564
+ | H.265 | ✅ Works | Uses FFmpeg's frame quality mechanism (0-51 range) |
565
+
566
+ **Note:** The 0-255 quantizer range for VP9/AV1 aligns with [Chromium's WebCodecs implementation](https://chromium-review.googlesource.com/c/chromium/src/+/7204065). Internally, values are converted to the 0-63 encoder range using `q_index / 4`.
567
+
536
568
  ## Logging
537
569
 
538
570
  This library uses Rust's `tracing` crate for structured logging. Enable logging via the `WEBCODECS_LOG` environment variable:
package/index.d.ts CHANGED
@@ -1079,7 +1079,12 @@ export declare class VideoFrame {
1079
1079
  * Options can specify target format and rect for cropped copy.
1080
1080
  */
1081
1081
  copyTo(destination: Uint8Array, options?: VideoFrameCopyToOptions | undefined | null): Promise<Array<PlaneLayout>>
1082
- /** Clone this VideoFrame */
1082
+ /**
1083
+ * Clone this VideoFrame
1084
+ *
1085
+ * This creates a new VideoFrame that shares the underlying pixel data with the original.
1086
+ * Both frames will reference the same Arc<RwLock<Frame>>, so no pixel data is copied.
1087
+ */
1083
1088
  clone(): VideoFrame
1084
1089
  /**
1085
1090
  * Close and release resources
@@ -1421,6 +1426,12 @@ export interface EncodedVideoChunkMetadataJs {
1421
1426
  decoderConfig?: VideoDecoderConfigJs
1422
1427
  /** SVC output metadata */
1423
1428
  svc?: SvcOutputMetadataJs
1429
+ /**
1430
+ * Alpha channel side data (for VP9 alpha support)
1431
+ * This contains the encoded alpha channel data that should be written
1432
+ * as BlockAdditions in WebM/MKV containers.
1433
+ */
1434
+ alphaSideData?: Uint8Array
1424
1435
  }
1425
1436
 
1426
1437
  /** Type of encoded video chunk */
@@ -1742,7 +1753,7 @@ export interface VideoEncoderEncodeOptions {
1742
1753
 
1743
1754
  /** AV1 encode options (W3C WebCodecs AV1 Registration) */
1744
1755
  export interface VideoEncoderEncodeOptionsForAv1 {
1745
- /** Per-frame quantizer (0-63, lower = higher quality) */
1756
+ /** Per-frame quantizer (0-255, lower = higher quality) */
1746
1757
  quantizer?: number
1747
1758
  }
1748
1759
 
@@ -1760,7 +1771,7 @@ export interface VideoEncoderEncodeOptionsForHevc {
1760
1771
 
1761
1772
  /** VP9 encode options (W3C WebCodecs VP9 Registration) */
1762
1773
  export interface VideoEncoderEncodeOptionsForVp9 {
1763
- /** Per-frame quantizer (0-63, lower = higher quality) */
1774
+ /** Per-frame quantizer (0-255, lower = higher quality) */
1764
1775
  quantizer?: number
1765
1776
  }
1766
1777
 
@@ -1920,4 +1931,6 @@ export interface WebMVideoTrackConfig {
1920
1931
  height: number
1921
1932
  /** Codec-specific description data */
1922
1933
  description?: Uint8Array
1934
+ /** Whether the video has alpha channel (VP9 alpha support) */
1935
+ alpha?: boolean
1923
1936
  }
package/index.js CHANGED
@@ -78,12 +78,12 @@ function requireNative() {
78
78
  const binding = require('@napi-rs/webcodecs-android-arm64')
79
79
  const bindingPackageVersion = require('@napi-rs/webcodecs-android-arm64/package.json').version
80
80
  if (
81
- bindingPackageVersion !== '1.2.0' &&
81
+ bindingPackageVersion !== '1.2.1' &&
82
82
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
83
83
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
84
84
  ) {
85
85
  throw new Error(
86
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
86
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
87
87
  )
88
88
  }
89
89
  return binding
@@ -100,12 +100,12 @@ function requireNative() {
100
100
  const binding = require('@napi-rs/webcodecs-android-arm-eabi')
101
101
  const bindingPackageVersion = require('@napi-rs/webcodecs-android-arm-eabi/package.json').version
102
102
  if (
103
- bindingPackageVersion !== '1.2.0' &&
103
+ bindingPackageVersion !== '1.2.1' &&
104
104
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
105
105
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
106
106
  ) {
107
107
  throw new Error(
108
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
108
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
109
109
  )
110
110
  }
111
111
  return binding
@@ -130,12 +130,12 @@ function requireNative() {
130
130
  const binding = require('@napi-rs/webcodecs-win32-x64-gnu')
131
131
  const bindingPackageVersion = require('@napi-rs/webcodecs-win32-x64-gnu/package.json').version
132
132
  if (
133
- bindingPackageVersion !== '1.2.0' &&
133
+ bindingPackageVersion !== '1.2.1' &&
134
134
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
135
135
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
136
136
  ) {
137
137
  throw new Error(
138
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
138
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
139
139
  )
140
140
  }
141
141
  return binding
@@ -152,12 +152,12 @@ function requireNative() {
152
152
  const binding = require('@napi-rs/webcodecs-win32-x64-msvc')
153
153
  const bindingPackageVersion = require('@napi-rs/webcodecs-win32-x64-msvc/package.json').version
154
154
  if (
155
- bindingPackageVersion !== '1.2.0' &&
155
+ bindingPackageVersion !== '1.2.1' &&
156
156
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
157
157
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
158
158
  ) {
159
159
  throw new Error(
160
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
160
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
161
161
  )
162
162
  }
163
163
  return binding
@@ -175,12 +175,12 @@ function requireNative() {
175
175
  const binding = require('@napi-rs/webcodecs-win32-ia32-msvc')
176
176
  const bindingPackageVersion = require('@napi-rs/webcodecs-win32-ia32-msvc/package.json').version
177
177
  if (
178
- bindingPackageVersion !== '1.2.0' &&
178
+ bindingPackageVersion !== '1.2.1' &&
179
179
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
180
180
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
181
181
  ) {
182
182
  throw new Error(
183
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
183
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
184
184
  )
185
185
  }
186
186
  return binding
@@ -197,12 +197,12 @@ function requireNative() {
197
197
  const binding = require('@napi-rs/webcodecs-win32-arm64-msvc')
198
198
  const bindingPackageVersion = require('@napi-rs/webcodecs-win32-arm64-msvc/package.json').version
199
199
  if (
200
- bindingPackageVersion !== '1.2.0' &&
200
+ bindingPackageVersion !== '1.2.1' &&
201
201
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
202
202
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
203
203
  ) {
204
204
  throw new Error(
205
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
205
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
206
206
  )
207
207
  }
208
208
  return binding
@@ -222,12 +222,12 @@ function requireNative() {
222
222
  const binding = require('@napi-rs/webcodecs-darwin-universal')
223
223
  const bindingPackageVersion = require('@napi-rs/webcodecs-darwin-universal/package.json').version
224
224
  if (
225
- bindingPackageVersion !== '1.2.0' &&
225
+ bindingPackageVersion !== '1.2.1' &&
226
226
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
227
227
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
228
228
  ) {
229
229
  throw new Error(
230
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
230
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
231
231
  )
232
232
  }
233
233
  return binding
@@ -244,12 +244,12 @@ function requireNative() {
244
244
  const binding = require('@napi-rs/webcodecs-darwin-x64')
245
245
  const bindingPackageVersion = require('@napi-rs/webcodecs-darwin-x64/package.json').version
246
246
  if (
247
- bindingPackageVersion !== '1.2.0' &&
247
+ bindingPackageVersion !== '1.2.1' &&
248
248
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
249
249
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
250
250
  ) {
251
251
  throw new Error(
252
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
252
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
253
253
  )
254
254
  }
255
255
  return binding
@@ -266,12 +266,12 @@ function requireNative() {
266
266
  const binding = require('@napi-rs/webcodecs-darwin-arm64')
267
267
  const bindingPackageVersion = require('@napi-rs/webcodecs-darwin-arm64/package.json').version
268
268
  if (
269
- bindingPackageVersion !== '1.2.0' &&
269
+ bindingPackageVersion !== '1.2.1' &&
270
270
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
271
271
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
272
272
  ) {
273
273
  throw new Error(
274
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
274
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
275
275
  )
276
276
  }
277
277
  return binding
@@ -292,12 +292,12 @@ function requireNative() {
292
292
  const binding = require('@napi-rs/webcodecs-freebsd-x64')
293
293
  const bindingPackageVersion = require('@napi-rs/webcodecs-freebsd-x64/package.json').version
294
294
  if (
295
- bindingPackageVersion !== '1.2.0' &&
295
+ bindingPackageVersion !== '1.2.1' &&
296
296
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
297
297
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
298
298
  ) {
299
299
  throw new Error(
300
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
300
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
301
301
  )
302
302
  }
303
303
  return binding
@@ -314,12 +314,12 @@ function requireNative() {
314
314
  const binding = require('@napi-rs/webcodecs-freebsd-arm64')
315
315
  const bindingPackageVersion = require('@napi-rs/webcodecs-freebsd-arm64/package.json').version
316
316
  if (
317
- bindingPackageVersion !== '1.2.0' &&
317
+ bindingPackageVersion !== '1.2.1' &&
318
318
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
319
319
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
320
320
  ) {
321
321
  throw new Error(
322
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
322
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
323
323
  )
324
324
  }
325
325
  return binding
@@ -341,12 +341,12 @@ function requireNative() {
341
341
  const binding = require('@napi-rs/webcodecs-linux-x64-musl')
342
342
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-x64-musl/package.json').version
343
343
  if (
344
- bindingPackageVersion !== '1.2.0' &&
344
+ bindingPackageVersion !== '1.2.1' &&
345
345
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
346
346
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
347
347
  ) {
348
348
  throw new Error(
349
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
349
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
350
350
  )
351
351
  }
352
352
  return binding
@@ -363,12 +363,12 @@ function requireNative() {
363
363
  const binding = require('@napi-rs/webcodecs-linux-x64-gnu')
364
364
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-x64-gnu/package.json').version
365
365
  if (
366
- bindingPackageVersion !== '1.2.0' &&
366
+ bindingPackageVersion !== '1.2.1' &&
367
367
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
368
368
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
369
369
  ) {
370
370
  throw new Error(
371
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
371
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
372
372
  )
373
373
  }
374
374
  return binding
@@ -387,12 +387,12 @@ function requireNative() {
387
387
  const binding = require('@napi-rs/webcodecs-linux-arm64-musl')
388
388
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-arm64-musl/package.json').version
389
389
  if (
390
- bindingPackageVersion !== '1.2.0' &&
390
+ bindingPackageVersion !== '1.2.1' &&
391
391
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
392
392
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
393
393
  ) {
394
394
  throw new Error(
395
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
395
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
396
396
  )
397
397
  }
398
398
  return binding
@@ -409,12 +409,12 @@ function requireNative() {
409
409
  const binding = require('@napi-rs/webcodecs-linux-arm64-gnu')
410
410
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-arm64-gnu/package.json').version
411
411
  if (
412
- bindingPackageVersion !== '1.2.0' &&
412
+ bindingPackageVersion !== '1.2.1' &&
413
413
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
414
414
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
415
415
  ) {
416
416
  throw new Error(
417
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
417
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
418
418
  )
419
419
  }
420
420
  return binding
@@ -433,12 +433,12 @@ function requireNative() {
433
433
  const binding = require('@napi-rs/webcodecs-linux-arm-musleabihf')
434
434
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-arm-musleabihf/package.json').version
435
435
  if (
436
- bindingPackageVersion !== '1.2.0' &&
436
+ bindingPackageVersion !== '1.2.1' &&
437
437
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
438
438
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
439
439
  ) {
440
440
  throw new Error(
441
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
441
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
442
442
  )
443
443
  }
444
444
  return binding
@@ -455,12 +455,12 @@ function requireNative() {
455
455
  const binding = require('@napi-rs/webcodecs-linux-arm-gnueabihf')
456
456
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-arm-gnueabihf/package.json').version
457
457
  if (
458
- bindingPackageVersion !== '1.2.0' &&
458
+ bindingPackageVersion !== '1.2.1' &&
459
459
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
460
460
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
461
461
  ) {
462
462
  throw new Error(
463
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
463
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
464
464
  )
465
465
  }
466
466
  return binding
@@ -479,12 +479,12 @@ function requireNative() {
479
479
  const binding = require('@napi-rs/webcodecs-linux-loong64-musl')
480
480
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-loong64-musl/package.json').version
481
481
  if (
482
- bindingPackageVersion !== '1.2.0' &&
482
+ bindingPackageVersion !== '1.2.1' &&
483
483
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
484
484
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
485
485
  ) {
486
486
  throw new Error(
487
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
487
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
488
488
  )
489
489
  }
490
490
  return binding
@@ -501,12 +501,12 @@ function requireNative() {
501
501
  const binding = require('@napi-rs/webcodecs-linux-loong64-gnu')
502
502
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-loong64-gnu/package.json').version
503
503
  if (
504
- bindingPackageVersion !== '1.2.0' &&
504
+ bindingPackageVersion !== '1.2.1' &&
505
505
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
506
506
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
507
507
  ) {
508
508
  throw new Error(
509
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
509
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
510
510
  )
511
511
  }
512
512
  return binding
@@ -525,12 +525,12 @@ function requireNative() {
525
525
  const binding = require('@napi-rs/webcodecs-linux-riscv64-musl')
526
526
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-riscv64-musl/package.json').version
527
527
  if (
528
- bindingPackageVersion !== '1.2.0' &&
528
+ bindingPackageVersion !== '1.2.1' &&
529
529
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
530
530
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
531
531
  ) {
532
532
  throw new Error(
533
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
533
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
534
534
  )
535
535
  }
536
536
  return binding
@@ -547,12 +547,12 @@ function requireNative() {
547
547
  const binding = require('@napi-rs/webcodecs-linux-riscv64-gnu')
548
548
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-riscv64-gnu/package.json').version
549
549
  if (
550
- bindingPackageVersion !== '1.2.0' &&
550
+ bindingPackageVersion !== '1.2.1' &&
551
551
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
552
552
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
553
553
  ) {
554
554
  throw new Error(
555
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
555
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
556
556
  )
557
557
  }
558
558
  return binding
@@ -570,12 +570,12 @@ function requireNative() {
570
570
  const binding = require('@napi-rs/webcodecs-linux-ppc64-gnu')
571
571
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-ppc64-gnu/package.json').version
572
572
  if (
573
- bindingPackageVersion !== '1.2.0' &&
573
+ bindingPackageVersion !== '1.2.1' &&
574
574
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
575
575
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
576
576
  ) {
577
577
  throw new Error(
578
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
578
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
579
579
  )
580
580
  }
581
581
  return binding
@@ -592,12 +592,12 @@ function requireNative() {
592
592
  const binding = require('@napi-rs/webcodecs-linux-s390x-gnu')
593
593
  const bindingPackageVersion = require('@napi-rs/webcodecs-linux-s390x-gnu/package.json').version
594
594
  if (
595
- bindingPackageVersion !== '1.2.0' &&
595
+ bindingPackageVersion !== '1.2.1' &&
596
596
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
597
597
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
598
598
  ) {
599
599
  throw new Error(
600
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
600
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
601
601
  )
602
602
  }
603
603
  return binding
@@ -618,12 +618,12 @@ function requireNative() {
618
618
  const binding = require('@napi-rs/webcodecs-openharmony-arm64')
619
619
  const bindingPackageVersion = require('@napi-rs/webcodecs-openharmony-arm64/package.json').version
620
620
  if (
621
- bindingPackageVersion !== '1.2.0' &&
621
+ bindingPackageVersion !== '1.2.1' &&
622
622
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
623
623
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
624
624
  ) {
625
625
  throw new Error(
626
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
626
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
627
627
  )
628
628
  }
629
629
  return binding
@@ -640,12 +640,12 @@ function requireNative() {
640
640
  const binding = require('@napi-rs/webcodecs-openharmony-x64')
641
641
  const bindingPackageVersion = require('@napi-rs/webcodecs-openharmony-x64/package.json').version
642
642
  if (
643
- bindingPackageVersion !== '1.2.0' &&
643
+ bindingPackageVersion !== '1.2.1' &&
644
644
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
645
645
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
646
646
  ) {
647
647
  throw new Error(
648
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
648
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
649
649
  )
650
650
  }
651
651
  return binding
@@ -662,12 +662,12 @@ function requireNative() {
662
662
  const binding = require('@napi-rs/webcodecs-openharmony-arm')
663
663
  const bindingPackageVersion = require('@napi-rs/webcodecs-openharmony-arm/package.json').version
664
664
  if (
665
- bindingPackageVersion !== '1.2.0' &&
665
+ bindingPackageVersion !== '1.2.1' &&
666
666
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
667
667
  process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
668
668
  ) {
669
669
  throw new Error(
670
- `Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
670
+ `Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
671
671
  )
672
672
  }
673
673
  return binding
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@napi-rs/webcodecs",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "WebCodecs API implementation for Node.js using FFmpeg",
5
5
  "keywords": [
6
6
  "N-API",
@@ -73,7 +73,7 @@
73
73
  "devDependencies": {
74
74
  "@emnapi/core": "^1.7.1",
75
75
  "@emnapi/runtime": "^1.7.1",
76
- "@napi-rs/canvas": "^0.1.84",
76
+ "@napi-rs/canvas": "^0.1.86",
77
77
  "@napi-rs/cli": "^3.5.0",
78
78
  "@napi-rs/wasm-runtime": "^1.1.0",
79
79
  "@oxc-node/core": "^0.0.35",
@@ -151,14 +151,14 @@
151
151
  "registry": "https://registry.npmjs.org/"
152
152
  },
153
153
  "optionalDependencies": {
154
- "@napi-rs/webcodecs-darwin-x64": "1.2.0",
155
- "@napi-rs/webcodecs-darwin-arm64": "1.2.0",
156
- "@napi-rs/webcodecs-linux-x64-gnu": "1.2.0",
157
- "@napi-rs/webcodecs-linux-x64-musl": "1.2.0",
158
- "@napi-rs/webcodecs-win32-x64-msvc": "1.2.0",
159
- "@napi-rs/webcodecs-linux-arm64-gnu": "1.2.0",
160
- "@napi-rs/webcodecs-linux-arm64-musl": "1.2.0",
161
- "@napi-rs/webcodecs-win32-arm64-msvc": "1.2.0",
162
- "@napi-rs/webcodecs-linux-arm-gnueabihf": "1.2.0"
154
+ "@napi-rs/webcodecs-darwin-x64": "1.2.1",
155
+ "@napi-rs/webcodecs-darwin-arm64": "1.2.1",
156
+ "@napi-rs/webcodecs-linux-x64-gnu": "1.2.1",
157
+ "@napi-rs/webcodecs-linux-x64-musl": "1.2.1",
158
+ "@napi-rs/webcodecs-win32-x64-msvc": "1.2.1",
159
+ "@napi-rs/webcodecs-linux-arm64-gnu": "1.2.1",
160
+ "@napi-rs/webcodecs-linux-arm64-musl": "1.2.1",
161
+ "@napi-rs/webcodecs-win32-arm64-msvc": "1.2.1",
162
+ "@napi-rs/webcodecs-linux-arm-gnueabihf": "1.2.1"
163
163
  }
164
164
  }