node-av-lgpl 0.0.0 → 7.1.0-beta.2

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 (311) hide show
  1. package/LICENSE.md +22 -0
  2. package/README.md +711 -0
  3. package/dist/api/audio-frame-buffer.d.ts +636 -0
  4. package/dist/api/audio-frame-buffer.js +1027 -0
  5. package/dist/api/audio-frame-buffer.js.map +1 -0
  6. package/dist/api/bitstream-filter.d.ts +938 -0
  7. package/dist/api/bitstream-filter.js +1427 -0
  8. package/dist/api/bitstream-filter.js.map +1 -0
  9. package/dist/api/constants.d.ts +44 -0
  10. package/dist/api/constants.js +45 -0
  11. package/dist/api/constants.js.map +1 -0
  12. package/dist/api/data/test_av1.ivf +0 -0
  13. package/dist/api/data/test_h264.h264 +0 -0
  14. package/dist/api/data/test_hevc.h265 +0 -0
  15. package/dist/api/data/test_mjpeg.mjpeg +0 -0
  16. package/dist/api/data/test_vp8.ivf +0 -0
  17. package/dist/api/data/test_vp9.ivf +0 -0
  18. package/dist/api/decoder.d.ts +1413 -0
  19. package/dist/api/decoder.js +2367 -0
  20. package/dist/api/decoder.js.map +1 -0
  21. package/dist/api/demuxer.d.ts +1295 -0
  22. package/dist/api/demuxer.js +2344 -0
  23. package/dist/api/demuxer.js.map +1 -0
  24. package/dist/api/device.d.ts +589 -0
  25. package/dist/api/device.js +964 -0
  26. package/dist/api/device.js.map +1 -0
  27. package/dist/api/encoder-pool.d.ts +262 -0
  28. package/dist/api/encoder-pool.js +397 -0
  29. package/dist/api/encoder-pool.js.map +1 -0
  30. package/dist/api/encoder.d.ts +1509 -0
  31. package/dist/api/encoder.js +2619 -0
  32. package/dist/api/encoder.js.map +1 -0
  33. package/dist/api/filter-complex.d.ts +828 -0
  34. package/dist/api/filter-complex.js +1661 -0
  35. package/dist/api/filter-complex.js.map +1 -0
  36. package/dist/api/filter-presets.d.ts +800 -0
  37. package/dist/api/filter-presets.js +1554 -0
  38. package/dist/api/filter-presets.js.map +1 -0
  39. package/dist/api/filter.d.ts +1339 -0
  40. package/dist/api/filter.js +2075 -0
  41. package/dist/api/filter.js.map +1 -0
  42. package/dist/api/fmp4-stream.d.ts +797 -0
  43. package/dist/api/fmp4-stream.js +1428 -0
  44. package/dist/api/fmp4-stream.js.map +1 -0
  45. package/dist/api/hardware.d.ts +677 -0
  46. package/dist/api/hardware.js +1300 -0
  47. package/dist/api/hardware.js.map +1 -0
  48. package/dist/api/index.d.ts +21 -0
  49. package/dist/api/index.js +38 -0
  50. package/dist/api/index.js.map +1 -0
  51. package/dist/api/io-stream.d.ts +308 -0
  52. package/dist/api/io-stream.js +358 -0
  53. package/dist/api/io-stream.js.map +1 -0
  54. package/dist/api/muxer.d.ts +1311 -0
  55. package/dist/api/muxer.js +2672 -0
  56. package/dist/api/muxer.js.map +1 -0
  57. package/dist/api/pipeline.d.ts +801 -0
  58. package/dist/api/pipeline.js +1344 -0
  59. package/dist/api/pipeline.js.map +1 -0
  60. package/dist/api/probe.d.ts +128 -0
  61. package/dist/api/probe.js +227 -0
  62. package/dist/api/probe.js.map +1 -0
  63. package/dist/api/rtp-stream.d.ts +497 -0
  64. package/dist/api/rtp-stream.js +1131 -0
  65. package/dist/api/rtp-stream.js.map +1 -0
  66. package/dist/api/scaler.d.ts +561 -0
  67. package/dist/api/scaler.js +918 -0
  68. package/dist/api/scaler.js.map +1 -0
  69. package/dist/api/types.d.ts +17 -0
  70. package/dist/api/types.js +2 -0
  71. package/dist/api/types.js.map +1 -0
  72. package/dist/api/utilities/async-queue.d.ts +149 -0
  73. package/dist/api/utilities/async-queue.js +254 -0
  74. package/dist/api/utilities/async-queue.js.map +1 -0
  75. package/dist/api/utilities/audio-sample.d.ts +117 -0
  76. package/dist/api/utilities/audio-sample.js +112 -0
  77. package/dist/api/utilities/audio-sample.js.map +1 -0
  78. package/dist/api/utilities/audio-transcode.d.ts +20 -0
  79. package/dist/api/utilities/audio-transcode.js +27 -0
  80. package/dist/api/utilities/audio-transcode.js.map +1 -0
  81. package/dist/api/utilities/channel-layout.d.ts +76 -0
  82. package/dist/api/utilities/channel-layout.js +80 -0
  83. package/dist/api/utilities/channel-layout.js.map +1 -0
  84. package/dist/api/utilities/codec-format.d.ts +87 -0
  85. package/dist/api/utilities/codec-format.js +117 -0
  86. package/dist/api/utilities/codec-format.js.map +1 -0
  87. package/dist/api/utilities/context-options.d.ts +25 -0
  88. package/dist/api/utilities/context-options.js +23 -0
  89. package/dist/api/utilities/context-options.js.map +1 -0
  90. package/dist/api/utilities/electron-shared-texture.d.ts +368 -0
  91. package/dist/api/utilities/electron-shared-texture.js +540 -0
  92. package/dist/api/utilities/electron-shared-texture.js.map +1 -0
  93. package/dist/api/utilities/image.d.ts +207 -0
  94. package/dist/api/utilities/image.js +213 -0
  95. package/dist/api/utilities/image.js.map +1 -0
  96. package/dist/api/utilities/index.d.ts +14 -0
  97. package/dist/api/utilities/index.js +27 -0
  98. package/dist/api/utilities/index.js.map +1 -0
  99. package/dist/api/utilities/live-decoding.d.ts +15 -0
  100. package/dist/api/utilities/live-decoding.js +32 -0
  101. package/dist/api/utilities/live-decoding.js.map +1 -0
  102. package/dist/api/utilities/media-type.d.ts +49 -0
  103. package/dist/api/utilities/media-type.js +53 -0
  104. package/dist/api/utilities/media-type.js.map +1 -0
  105. package/dist/api/utilities/packet-age-watchdog.d.ts +198 -0
  106. package/dist/api/utilities/packet-age-watchdog.js +594 -0
  107. package/dist/api/utilities/packet-age-watchdog.js.map +1 -0
  108. package/dist/api/utilities/pixel-format.d.ts +89 -0
  109. package/dist/api/utilities/pixel-format.js +97 -0
  110. package/dist/api/utilities/pixel-format.js.map +1 -0
  111. package/dist/api/utilities/sample-format.d.ts +129 -0
  112. package/dist/api/utilities/sample-format.js +141 -0
  113. package/dist/api/utilities/sample-format.js.map +1 -0
  114. package/dist/api/utilities/scale-size.d.ts +51 -0
  115. package/dist/api/utilities/scale-size.js +55 -0
  116. package/dist/api/utilities/scale-size.js.map +1 -0
  117. package/dist/api/utilities/scheduler.d.ts +138 -0
  118. package/dist/api/utilities/scheduler.js +98 -0
  119. package/dist/api/utilities/scheduler.js.map +1 -0
  120. package/dist/api/utilities/streaming.d.ts +186 -0
  121. package/dist/api/utilities/streaming.js +309 -0
  122. package/dist/api/utilities/streaming.js.map +1 -0
  123. package/dist/api/utilities/timestamp.d.ts +193 -0
  124. package/dist/api/utilities/timestamp.js +206 -0
  125. package/dist/api/utilities/timestamp.js.map +1 -0
  126. package/dist/api/utilities/video-transcode.d.ts +218 -0
  127. package/dist/api/utilities/video-transcode.js +624 -0
  128. package/dist/api/utilities/video-transcode.js.map +1 -0
  129. package/dist/api/utilities/whisper-model.d.ts +330 -0
  130. package/dist/api/utilities/whisper-model.js +587 -0
  131. package/dist/api/utilities/whisper-model.js.map +1 -0
  132. package/dist/api/utils.d.ts +19 -0
  133. package/dist/api/utils.js +39 -0
  134. package/dist/api/utils.js.map +1 -0
  135. package/dist/api/webrtc-stream.d.ts +294 -0
  136. package/dist/api/webrtc-stream.js +546 -0
  137. package/dist/api/webrtc-stream.js.map +1 -0
  138. package/dist/api/whisper.d.ts +326 -0
  139. package/dist/api/whisper.js +402 -0
  140. package/dist/api/whisper.js.map +1 -0
  141. package/dist/constants/bsf-options.d.ts +364 -0
  142. package/dist/constants/bsf-options.js +7 -0
  143. package/dist/constants/bsf-options.js.map +1 -0
  144. package/dist/constants/channel-layouts.d.ts +53 -0
  145. package/dist/constants/channel-layouts.js +57 -0
  146. package/dist/constants/channel-layouts.js.map +1 -0
  147. package/dist/constants/constants.d.ts +2435 -0
  148. package/dist/constants/constants.js +1989 -0
  149. package/dist/constants/constants.js.map +1 -0
  150. package/dist/constants/decoders.d.ts +651 -0
  151. package/dist/constants/decoders.js +641 -0
  152. package/dist/constants/decoders.js.map +1 -0
  153. package/dist/constants/encoders.d.ts +314 -0
  154. package/dist/constants/encoders.js +309 -0
  155. package/dist/constants/encoders.js.map +1 -0
  156. package/dist/constants/filter-options.d.ts +12099 -0
  157. package/dist/constants/filter-options.js +7 -0
  158. package/dist/constants/filter-options.js.map +1 -0
  159. package/dist/constants/format-options.d.ts +4319 -0
  160. package/dist/constants/format-options.js +7 -0
  161. package/dist/constants/format-options.js.map +1 -0
  162. package/dist/constants/formats.d.ts +18 -0
  163. package/dist/constants/formats.js +7 -0
  164. package/dist/constants/formats.js.map +1 -0
  165. package/dist/constants/hardware.d.ts +26 -0
  166. package/dist/constants/hardware.js +27 -0
  167. package/dist/constants/hardware.js.map +1 -0
  168. package/dist/constants/index.d.ts +10 -0
  169. package/dist/constants/index.js +6 -0
  170. package/dist/constants/index.js.map +1 -0
  171. package/dist/constants/options.d.ts +6217 -0
  172. package/dist/constants/options.js +7 -0
  173. package/dist/constants/options.js.map +1 -0
  174. package/dist/ffmpeg/index.d.ts +101 -0
  175. package/dist/ffmpeg/index.js +161 -0
  176. package/dist/ffmpeg/index.js.map +1 -0
  177. package/dist/ffmpeg/version.d.ts +6 -0
  178. package/dist/ffmpeg/version.js +7 -0
  179. package/dist/ffmpeg/version.js.map +1 -0
  180. package/dist/index.d.ts +4 -0
  181. package/dist/index.js +9 -0
  182. package/dist/index.js.map +1 -0
  183. package/dist/lib/audio-fifo.d.ts +399 -0
  184. package/dist/lib/audio-fifo.js +431 -0
  185. package/dist/lib/audio-fifo.js.map +1 -0
  186. package/dist/lib/binding.d.ts +242 -0
  187. package/dist/lib/binding.js +102 -0
  188. package/dist/lib/binding.js.map +1 -0
  189. package/dist/lib/bitstream-filter-context.d.ts +381 -0
  190. package/dist/lib/bitstream-filter-context.js +443 -0
  191. package/dist/lib/bitstream-filter-context.js.map +1 -0
  192. package/dist/lib/bitstream-filter.d.ts +140 -0
  193. package/dist/lib/bitstream-filter.js +154 -0
  194. package/dist/lib/bitstream-filter.js.map +1 -0
  195. package/dist/lib/codec-context.d.ts +1069 -0
  196. package/dist/lib/codec-context.js +1336 -0
  197. package/dist/lib/codec-context.js.map +1 -0
  198. package/dist/lib/codec-parameters.d.ts +664 -0
  199. package/dist/lib/codec-parameters.js +813 -0
  200. package/dist/lib/codec-parameters.js.map +1 -0
  201. package/dist/lib/codec-parser.d.ts +201 -0
  202. package/dist/lib/codec-parser.js +213 -0
  203. package/dist/lib/codec-parser.js.map +1 -0
  204. package/dist/lib/codec.d.ts +617 -0
  205. package/dist/lib/codec.js +746 -0
  206. package/dist/lib/codec.js.map +1 -0
  207. package/dist/lib/device.d.ts +294 -0
  208. package/dist/lib/device.js +326 -0
  209. package/dist/lib/device.js.map +1 -0
  210. package/dist/lib/dictionary.d.ts +333 -0
  211. package/dist/lib/dictionary.js +372 -0
  212. package/dist/lib/dictionary.js.map +1 -0
  213. package/dist/lib/error.d.ts +311 -0
  214. package/dist/lib/error.js +395 -0
  215. package/dist/lib/error.js.map +1 -0
  216. package/dist/lib/fifo.d.ts +416 -0
  217. package/dist/lib/fifo.js +453 -0
  218. package/dist/lib/fifo.js.map +1 -0
  219. package/dist/lib/filter-context.d.ts +714 -0
  220. package/dist/lib/filter-context.js +783 -0
  221. package/dist/lib/filter-context.js.map +1 -0
  222. package/dist/lib/filter-graph-segment.d.ts +161 -0
  223. package/dist/lib/filter-graph-segment.js +172 -0
  224. package/dist/lib/filter-graph-segment.js.map +1 -0
  225. package/dist/lib/filter-graph.d.ts +641 -0
  226. package/dist/lib/filter-graph.js +704 -0
  227. package/dist/lib/filter-graph.js.map +1 -0
  228. package/dist/lib/filter-inout.d.ts +202 -0
  229. package/dist/lib/filter-inout.js +261 -0
  230. package/dist/lib/filter-inout.js.map +1 -0
  231. package/dist/lib/filter.d.ts +243 -0
  232. package/dist/lib/filter.js +272 -0
  233. package/dist/lib/filter.js.map +1 -0
  234. package/dist/lib/format-context.d.ts +1335 -0
  235. package/dist/lib/format-context.js +1455 -0
  236. package/dist/lib/format-context.js.map +1 -0
  237. package/dist/lib/frame-utils.d.ts +116 -0
  238. package/dist/lib/frame-utils.js +98 -0
  239. package/dist/lib/frame-utils.js.map +1 -0
  240. package/dist/lib/frame.d.ts +1315 -0
  241. package/dist/lib/frame.js +1535 -0
  242. package/dist/lib/frame.js.map +1 -0
  243. package/dist/lib/hardware-device-context.d.ts +362 -0
  244. package/dist/lib/hardware-device-context.js +383 -0
  245. package/dist/lib/hardware-device-context.js.map +1 -0
  246. package/dist/lib/hardware-frames-context.d.ts +418 -0
  247. package/dist/lib/hardware-frames-context.js +471 -0
  248. package/dist/lib/hardware-frames-context.js.map +1 -0
  249. package/dist/lib/index.d.ts +35 -0
  250. package/dist/lib/index.js +60 -0
  251. package/dist/lib/index.js.map +1 -0
  252. package/dist/lib/input-format.d.ts +249 -0
  253. package/dist/lib/input-format.js +306 -0
  254. package/dist/lib/input-format.js.map +1 -0
  255. package/dist/lib/io-context.d.ts +698 -0
  256. package/dist/lib/io-context.js +771 -0
  257. package/dist/lib/io-context.js.map +1 -0
  258. package/dist/lib/log.d.ts +174 -0
  259. package/dist/lib/log.js +184 -0
  260. package/dist/lib/log.js.map +1 -0
  261. package/dist/lib/native-types.d.ts +1024 -0
  262. package/dist/lib/native-types.js +2 -0
  263. package/dist/lib/native-types.js.map +1 -0
  264. package/dist/lib/option.d.ts +953 -0
  265. package/dist/lib/option.js +1607 -0
  266. package/dist/lib/option.js.map +1 -0
  267. package/dist/lib/output-format.d.ts +222 -0
  268. package/dist/lib/output-format.js +259 -0
  269. package/dist/lib/output-format.js.map +1 -0
  270. package/dist/lib/packet.d.ts +521 -0
  271. package/dist/lib/packet.js +613 -0
  272. package/dist/lib/packet.js.map +1 -0
  273. package/dist/lib/rational.d.ts +251 -0
  274. package/dist/lib/rational.js +278 -0
  275. package/dist/lib/rational.js.map +1 -0
  276. package/dist/lib/software-resample-context.d.ts +552 -0
  277. package/dist/lib/software-resample-context.js +592 -0
  278. package/dist/lib/software-resample-context.js.map +1 -0
  279. package/dist/lib/software-scale-context.d.ts +344 -0
  280. package/dist/lib/software-scale-context.js +366 -0
  281. package/dist/lib/software-scale-context.js.map +1 -0
  282. package/dist/lib/stream.d.ts +384 -0
  283. package/dist/lib/stream.js +525 -0
  284. package/dist/lib/stream.js.map +1 -0
  285. package/dist/lib/sync-queue.d.ts +179 -0
  286. package/dist/lib/sync-queue.js +197 -0
  287. package/dist/lib/sync-queue.js.map +1 -0
  288. package/dist/lib/types.d.ts +34 -0
  289. package/dist/lib/types.js +2 -0
  290. package/dist/lib/types.js.map +1 -0
  291. package/dist/lib/utilities.d.ts +1198 -0
  292. package/dist/lib/utilities.js +1302 -0
  293. package/dist/lib/utilities.js.map +1 -0
  294. package/dist/utils/electron.d.ts +49 -0
  295. package/dist/utils/electron.js +63 -0
  296. package/dist/utils/electron.js.map +1 -0
  297. package/dist/utils/index.d.ts +6 -0
  298. package/dist/utils/index.js +7 -0
  299. package/dist/utils/index.js.map +1 -0
  300. package/dist/utils/libc.d.ts +11 -0
  301. package/dist/utils/libc.js +35 -0
  302. package/dist/utils/libc.js.map +1 -0
  303. package/dist/utils/variant.d.ts +26 -0
  304. package/dist/utils/variant.js +31 -0
  305. package/dist/utils/variant.js.map +1 -0
  306. package/dist/webrtc/index.d.ts +4 -0
  307. package/dist/webrtc/index.js +7 -0
  308. package/dist/webrtc/index.js.map +1 -0
  309. package/install/check.js +124 -0
  310. package/install/ffmpeg.js +66 -0
  311. package/package.json +165 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../src/lib/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAQzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,aAAa;IAa3B,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAyB;IAC3D,OAAO,QAAQ,CAAC,m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AAI,SAAS,EAAE,CAAC;gBACd,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC;IAEtC,oDAAoD;IACpD,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,QAAQ,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,UAAU,CAAC,MAAmC,EAAE,MAAmC,EAAE,KAAsB;IACzH,OAAO,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,KAAK,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,6BAA6B;AAC3J,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Convert an ASAR path to its unpacked equivalent.
3
+ *
4
+ * In Electron applications with ASAR packaging, certain files (native modules,
5
+ * binaries, data files) must be unpacked and are stored in `app.asar.unpacked`
6
+ * instead of inside `app.asar`. This function converts paths accordingly.
7
+ *
8
+ * If the path doesn't contain `app.asar`, it's returned unchanged.
9
+ *
10
+ * @param path - The path to convert
11
+ *
12
+ * @returns The path with `app.asar` replaced by `app.asar.unpacked`
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * import { getUnpackedPath } from '../utils/electron.js';
17
+ *
18
+ * // In Electron with ASAR:
19
+ * // Input: /path/to/app.asar/node_modules/node-av/binary/ffmpeg
20
+ * // Output: /path/to/app.asar.unpacked/node_modules/node-av/binary/ffmpeg
21
+ *
22
+ * const binaryPath = getUnpackedPath(__dirname);
23
+ * ```
24
+ */
25
+ export declare function getUnpackedPath(path: string): string;
26
+ /**
27
+ * Get the directory name from an import.meta.url, with Electron ASAR handling.
28
+ *
29
+ * This is a convenience function that combines `fileURLToPath`, `dirname`,
30
+ * and ASAR path conversion. Use this instead of manually creating `__dirname`
31
+ * when the directory contains files that need to be unpacked from ASAR.
32
+ *
33
+ * @param importMetaUrl - The `import.meta.url` from the calling module
34
+ *
35
+ * @returns The directory path, adjusted for Electron ASAR if applicable
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * import { getDirname } from '../utils/electron.js';
40
+ *
41
+ * // Instead of:
42
+ * // const __filename = fileURLToPath(import.meta.url);
43
+ * // const __dirname = dirname(__filename).replace(/app\.asar([/\\])/, 'app.asar.unpacked$1');
44
+ *
45
+ * // Use:
46
+ * const __dirname = getDirname(import.meta.url);
47
+ * ```
48
+ */
49
+ export declare function getDirname(importMetaUrl: string): string;
@@ -0,0 +1,63 @@
1
+ import { dirname } from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ /**
4
+ * Regular expression to match Electron ASAR paths.
5
+ * Matches `app.asar/` or `app.asar\` (Windows).
6
+ */
7
+ const ASAR_PATH_REGEX = /app\.asar([/\\])/;
8
+ /**
9
+ * Convert an ASAR path to its unpacked equivalent.
10
+ *
11
+ * In Electron applications with ASAR packaging, certain files (native modules,
12
+ * binaries, data files) must be unpacked and are stored in `app.asar.unpacked`
13
+ * instead of inside `app.asar`. This function converts paths accordingly.
14
+ *
15
+ * If the path doesn't contain `app.asar`, it's returned unchanged.
16
+ *
17
+ * @param path - The path to convert
18
+ *
19
+ * @returns The path with `app.asar` replaced by `app.asar.unpacked`
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * import { getUnpackedPath } from '../utils/electron.js';
24
+ *
25
+ * // In Electron with ASAR:
26
+ * // Input: /path/to/app.asar/node_modules/node-av/binary/ffmpeg
27
+ * // Output: /path/to/app.asar.unpacked/node_modules/node-av/binary/ffmpeg
28
+ *
29
+ * const binaryPath = getUnpackedPath(__dirname);
30
+ * ```
31
+ */
32
+ export function getUnpackedPath(path) {
33
+ return path.replace(ASAR_PATH_REGEX, 'app.asar.unpacked$1');
34
+ }
35
+ /**
36
+ * Get the directory name from an import.meta.url, with Electron ASAR handling.
37
+ *
38
+ * This is a convenience function that combines `fileURLToPath`, `dirname`,
39
+ * and ASAR path conversion. Use this instead of manually creating `__dirname`
40
+ * when the directory contains files that need to be unpacked from ASAR.
41
+ *
42
+ * @param importMetaUrl - The `import.meta.url` from the calling module
43
+ *
44
+ * @returns The directory path, adjusted for Electron ASAR if applicable
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * import { getDirname } from '../utils/electron.js';
49
+ *
50
+ * // Instead of:
51
+ * // const __filename = fileURLToPath(import.meta.url);
52
+ * // const __dirname = dirname(__filename).replace(/app\.asar([/\\])/, 'app.asar.unpacked$1');
53
+ *
54
+ * // Use:
55
+ * const __dirname = getDirname(import.meta.url);
56
+ * ```
57
+ */
58
+ export function getDirname(importMetaUrl) {
59
+ const __filename = fileURLToPath(importMetaUrl);
60
+ const __dirname = dirname(__filename);
61
+ return getUnpackedPath(__dirname);
62
+ }
63
+ //# sourceMappingURL=electron.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electron.js","sourceRoot":"","sources":["../../src/utils/electron.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;GAGG;AACH,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,UAAU,CAAC,aAAqB;IAC9C,MAAM,UAAU,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Internal utilities
3
+ */
4
+ export { getDirname, getUnpackedPath } from './electron.js';
5
+ export { isMusl } from './libc.js';
6
+ export { ffmpegPackageName, nativePackagePrefix, VARIANT } from './variant.js';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Internal utilities
3
+ */
4
+ export { getDirname, getUnpackedPath } from './electron.js';
5
+ export { isMusl } from './libc.js';
6
+ export { ffmpegPackageName, nativePackagePrefix, VARIANT } from './variant.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Check whether this Node.js runs on musl libc (Alpine Linux and other musl distributions).
3
+ *
4
+ * Only a glibc build of Node.js carries a glibc runtime version in its diagnostic report.
5
+ * Network details are left out of the report, resolving open sockets can take seconds.
6
+ *
7
+ * @returns True on Linux with a musl build of Node.js
8
+ *
9
+ * @internal
10
+ */
11
+ export declare function isMusl(): boolean;
@@ -0,0 +1,35 @@
1
+ let musl;
2
+ /**
3
+ * Check whether this Node.js runs on musl libc (Alpine Linux and other musl distributions).
4
+ *
5
+ * Only a glibc build of Node.js carries a glibc runtime version in its diagnostic report.
6
+ * Network details are left out of the report, resolving open sockets can take seconds.
7
+ *
8
+ * @returns True on Linux with a musl build of Node.js
9
+ *
10
+ * @internal
11
+ */
12
+ export function isMusl() {
13
+ if (musl !== undefined) {
14
+ return musl;
15
+ }
16
+ musl = false;
17
+ if (process.platform !== 'linux') {
18
+ return musl;
19
+ }
20
+ const report = process.report;
21
+ const excludeNetwork = report.excludeNetwork;
22
+ try {
23
+ report.excludeNetwork = true;
24
+ const { header } = report.getReport();
25
+ musl = !header?.glibcVersionRuntime;
26
+ }
27
+ catch {
28
+ // No report available, assume glibc
29
+ }
30
+ finally {
31
+ report.excludeNetwork = excludeNetwork;
32
+ }
33
+ return musl;
34
+ }
35
+ //# sourceMappingURL=libc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"libc.js","sourceRoot":"","sources":["../../src/utils/libc.ts"],"names":[],"mappings":"AAAA,IAAI,IAAyB,CAAC;AAE9B;;;;;;;;;GASG;AACH,MAAM,UAAU,MAAM;IACpB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,GAAG,KAAK,CAAC;IACb,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,MAA6D,CAAC;IACrF,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IAC7C,IAAI,CAAC;QACH,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,SAAS,EAAmD,CAAC;QACvF,IAAI,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,oCAAoC;IACtC,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,cAAc,GAAG,cAAc,CAAC;IACzC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * FFmpeg build variant of this package.
3
+ *
4
+ * `gpl` is published as node-av, `lgpl` as node-av-lgpl and `light` as node-av-light.
5
+ * The release workflow sets it in the compiled file of each variant package, which
6
+ * picks the native binding and the FFmpeg CLI package of that variant.
7
+ *
8
+ * @internal
9
+ */
10
+ export declare const VARIANT: 'gpl' | 'lgpl' | 'light';
11
+ /**
12
+ * Name prefix of the variant's platform packages with the native binding.
13
+ *
14
+ * @returns Package name prefix, e.g. `@seydx/node-av` or `@seydx/node-av-lgpl`
15
+ *
16
+ * @internal
17
+ */
18
+ export declare function nativePackagePrefix(): string;
19
+ /**
20
+ * Name of the variant's FFmpeg CLI package.
21
+ *
22
+ * @returns Package name, e.g. `@seydx/node-av-ffmpeg` or `@seydx/node-av-ffmpeg-lgpl`
23
+ *
24
+ * @internal
25
+ */
26
+ export declare function ffmpegPackageName(): string;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * FFmpeg build variant of this package.
3
+ *
4
+ * `gpl` is published as node-av, `lgpl` as node-av-lgpl and `light` as node-av-light.
5
+ * The release workflow sets it in the compiled file of each variant package, which
6
+ * picks the native binding and the FFmpeg CLI package of that variant.
7
+ *
8
+ * @internal
9
+ */
10
+ export const VARIANT = 'lgpl';
11
+ /**
12
+ * Name prefix of the variant's platform packages with the native binding.
13
+ *
14
+ * @returns Package name prefix, e.g. `@seydx/node-av` or `@seydx/node-av-lgpl`
15
+ *
16
+ * @internal
17
+ */
18
+ export function nativePackagePrefix() {
19
+ return VARIANT === 'gpl' ? '@seydx/node-av' : `@seydx/node-av-${VARIANT}`;
20
+ }
21
+ /**
22
+ * Name of the variant's FFmpeg CLI package.
23
+ *
24
+ * @returns Package name, e.g. `@seydx/node-av-ffmpeg` or `@seydx/node-av-ffmpeg-lgpl`
25
+ *
26
+ * @internal
27
+ */
28
+ export function ffmpegPackageName() {
29
+ return VARIANT === 'gpl' ? '@seydx/node-av-ffmpeg' : `@seydx/node-av-ffmpeg-${VARIANT}`;
30
+ }
31
+ //# sourceMappingURL=variant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variant.js","sourceRoot":"","sources":["../../src/utils/variant.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,OAAO,GAA6B,KAAK,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,kBAAkB,OAAO,EAAE,CAAC;AAC5E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,yBAAyB,OAAO,EAAE,CAAC;AAC1F,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { WebRTCStream, type WebRTCCodecInfo, type WebRTCStreamOptions } from '../api/webrtc-stream.js';
2
+ export { RTPStream, type RTPStreamOptions } from '../api/rtp-stream.js';
3
+ export type { MediaFrameSource } from '../api/types.js';
4
+ export { MediaStreamTrack, RTCIceCandidate, RTCPeerConnection, RTCRtpCodecParameters, RTCSessionDescription, RtpPacket, type PeerConfig } from 'werift';
@@ -0,0 +1,7 @@
1
+ // WebRTC Stream
2
+ export { WebRTCStream } from '../api/webrtc-stream.js';
3
+ // RTP Stream
4
+ export { RTPStream } from '../api/rtp-stream.js';
5
+ // Re-export werift primitives used by the WebRTC/RTP APIs
6
+ export { MediaStreamTrack, RTCIceCandidate, RTCPeerConnection, RTCRtpCodecParameters, RTCSessionDescription, RtpPacket } from 'werift';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webrtc/index.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAkD,MAAM,yBAAyB,CAAC;AAEvG,aAAa;AACb,OAAO,EAAE,SAAS,EAAyB,MAAM,sBAAsB,CAAC;AAGxE,0DAA0D;AAC1D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,SAAS,EAAmB,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync, readFileSync } from 'node:fs';
4
+ import { createRequire } from 'node:module';
5
+ import { join } from 'node:path';
6
+
7
+ import { log } from './ffmpeg.js';
8
+
9
+ const require = createRequire(import.meta.url);
10
+
11
+ // node-av, node-av-lgpl and node-av-light each install their own platform packages
12
+ // (@seydx/node-av-linux-x64, @seydx/node-av-lgpl-linux-x64, ...)
13
+ const { name } = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
14
+ const packagePrefix = `@seydx/${name}`;
15
+
16
+ const tryLoadPrebuilt = () => {
17
+ // Try to load from platform-specific package (optionalDependencies)
18
+ const { platform, arch, musl } = installTarget();
19
+
20
+ if (platform === 'win32') {
21
+ // MinGW builds are discontinued, Windows ships MSVC only
22
+ // const useMingW = type() !== 'Windows_NT';
23
+ // if (useMingW) {
24
+ // try {
25
+ // const packageName = `@seydx/node-av-${platform}-${arch}-mingw`;
26
+ // const packageJsonPath = require.resolve(`${packageName}/package.json`);
27
+ // if (existsSync(packageJsonPath)) {
28
+ // log(`Using prebuilt binary from ${packageName}`);
29
+ // return true;
30
+ // }
31
+ // } catch {
32
+ // // Package not installed
33
+ // }
34
+ // }
35
+
36
+ try {
37
+ const packageName = `${packagePrefix}-${platform}-${arch}-msvc`;
38
+ // Check if the package is installed (don't check for .node file yet - it may be extracted by postinstall)
39
+ const packageJsonPath = require.resolve(`${packageName}/package.json`);
40
+ if (existsSync(packageJsonPath)) {
41
+ log(`Using prebuilt binary from ${packageName}`);
42
+ return true;
43
+ }
44
+ } catch {
45
+ // Package not installed
46
+ }
47
+ } else {
48
+ // musl (Alpine) has its own build, a glibc one doesn't load there
49
+ const packageName = `${packagePrefix}-${platform}-${arch}${musl ? '-musl' : ''}`;
50
+
51
+ try {
52
+ // Check if the package is installed (don't check for .node file yet - it may be extracted by postinstall)
53
+ const packageJsonPath = require.resolve(`${packageName}/package.json`);
54
+ if (existsSync(packageJsonPath)) {
55
+ log(`Using prebuilt binary from ${packageName}`);
56
+ return true;
57
+ }
58
+ } catch {
59
+ // Package not installed
60
+ }
61
+ }
62
+
63
+ // Try local binary folder (for development)
64
+ const localBinary = join(process.cwd(), 'binary', 'node-av.node');
65
+ if (existsSync(localBinary)) {
66
+ log('Using local binary from binary/node-av.node');
67
+ return true;
68
+ }
69
+
70
+ return false;
71
+ };
72
+
73
+ // A cross build (npm --os/--cpu/--libc) installs the target's package, not the build host's
74
+ const installTarget = () => {
75
+ const platform = process.env.npm_config_os || process.platform;
76
+ const arch = process.env.npm_config_cpu || process.arch;
77
+ const libc = process.env.npm_config_libc || (isMuslLibc() ? 'musl' : 'glibc');
78
+ return { platform, arch, musl: platform === 'linux' && libc === 'musl' };
79
+ };
80
+
81
+ const isMuslLibc = () => {
82
+ if (process.platform !== 'linux') {
83
+ return false;
84
+ }
85
+
86
+ try {
87
+ const report = process.report?.getReport?.();
88
+ return !report?.header?.glibcVersionRuntime;
89
+ } catch {
90
+ return false;
91
+ }
92
+ };
93
+
94
+ const noPrebuiltError = () => {
95
+ const { platform, arch, musl } = installTarget();
96
+ log('');
97
+ log(`No prebuilt binary available for ${platform}-${arch}${musl ? ' (musl)' : ''}.`);
98
+ log('The published npm package does not contain the native sources,');
99
+ log('so it cannot be built from source inside node_modules.');
100
+ log('To build from source, clone the repository and follow the build instructions:');
101
+ log(' https://github.com/seydx/node-av');
102
+ process.exit(1);
103
+ };
104
+
105
+ (async () => {
106
+ try {
107
+ const shouldBuildFromSource = process.env.npm_config_build_from_source === 'true';
108
+
109
+ if (shouldBuildFromSource) {
110
+ log('--build-from-source was specified, but the published npm package cannot be built from source.');
111
+ noPrebuiltError();
112
+ }
113
+
114
+ // Try to use prebuilt binary
115
+ if (tryLoadPrebuilt()) {
116
+ return;
117
+ }
118
+
119
+ noPrebuiltError();
120
+ } catch (err) {
121
+ console.error(`node-av: Installation error: ${err.message}`);
122
+ process.exit(1);
123
+ }
124
+ })();
@@ -0,0 +1,66 @@
1
+ // Adapted from https://github.com/lovell/sharp/blob/main/lib/libvips.js
2
+
3
+ import { spawnSync } from 'node:child_process';
4
+
5
+ const spawnSyncOptions = {
6
+ encoding: 'utf8',
7
+ shell: true,
8
+ };
9
+
10
+ export const log = (item) => {
11
+ if (item instanceof Error) {
12
+ console.error(`node-av: Installation error: ${item.message}`);
13
+ } else {
14
+ console.log(`node-av: ${item}`);
15
+ }
16
+ };
17
+
18
+ export const spawnRebuild = () =>
19
+ spawnSync('node-gyp rebuild', {
20
+ ...spawnSyncOptions,
21
+ stdio: 'inherit',
22
+ }).status;
23
+
24
+ export const pkgConfigPath = () => {
25
+ if (process.platform === 'win32') {
26
+ return '';
27
+ }
28
+
29
+ const paths = [];
30
+
31
+ // Try homebrew path on macOS
32
+ if (process.platform === 'darwin') {
33
+ const brewPath = spawnSync('brew --prefix 2>/dev/null', spawnSyncOptions).stdout;
34
+ if (brewPath) {
35
+ paths.push(`${brewPath.trim()}/lib/pkgconfig`);
36
+ }
37
+ }
38
+
39
+ // Add standard paths
40
+ paths.push(process.env.PKG_CONFIG_PATH, '/usr/local/lib/pkgconfig', '/usr/lib/pkgconfig', '/usr/local/libdata/pkgconfig', '/usr/libdata/pkgconfig');
41
+
42
+ return paths.filter(Boolean).join(':');
43
+ };
44
+
45
+ export const useGlobalFFmpeg = () => {
46
+ if (process.platform === 'win32') {
47
+ return false;
48
+ }
49
+
50
+ let ffmpegVersion =
51
+ spawnSync('pkg-config --modversion libavcodec', {
52
+ ...spawnSyncOptions,
53
+ env: {
54
+ ...process.env,
55
+ PKG_CONFIG_PATH: pkgConfigPath(),
56
+ },
57
+ }).stdout || '';
58
+
59
+ ffmpegVersion = ffmpegVersion.trim();
60
+
61
+ if (!ffmpegVersion) {
62
+ return false;
63
+ }
64
+
65
+ return true;
66
+ };
package/package.json CHANGED
@@ -1,7 +1,169 @@
1
1
  {
2
2
  "name": "node-av-lgpl",
3
- "version": "0.0.0",
4
- "description": "Placeholder. Install node-av-lgpl@beta (or >= 7.1.0).",
3
+ "version": "7.1.0-beta.2",
4
+ "description": "FFmpeg bindings for Node.js (LGPL build)",
5
+ "author": "seydx (https://github.com/seydx/node-av)",
6
+ "type": "module",
7
+ "engines": {
8
+ "node": ">=22.18.0"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "install",
13
+ "README.md",
14
+ "LICENSE.md"
15
+ ],
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "require": "./dist/index.js",
22
+ "default": "./dist/index.js"
23
+ },
24
+ "./api": {
25
+ "types": "./dist/api/index.d.ts",
26
+ "require": "./dist/api/index.js",
27
+ "default": "./dist/api/index.js"
28
+ },
29
+ "./lib": {
30
+ "types": "./dist/lib/index.d.ts",
31
+ "require": "./dist/lib/index.js",
32
+ "default": "./dist/lib/index.js"
33
+ },
34
+ "./constants": {
35
+ "types": "./dist/constants/index.d.ts",
36
+ "require": "./dist/constants/index.js",
37
+ "default": "./dist/constants/index.js"
38
+ },
39
+ "./ffmpeg": {
40
+ "types": "./dist/ffmpeg/index.d.ts",
41
+ "require": "./dist/ffmpeg/index.js",
42
+ "default": "./dist/ffmpeg/index.js"
43
+ },
44
+ "./webrtc": {
45
+ "types": "./dist/webrtc/index.d.ts",
46
+ "require": "./dist/webrtc/index.js",
47
+ "default": "./dist/webrtc/index.js"
48
+ }
49
+ },
50
+ "scripts": {
51
+ "benchmark": "tsx benchmarks/index.ts",
52
+ "build": "npm run generate && npm run build:tests && npm run build:examples && npm run build:tsc && npm run build:native",
53
+ "build:benchmarks": "tsc -p tsconfig.benchmarks.json",
54
+ "build:examples": "tsc -p tsconfig.examples.json",
55
+ "build:native": "node-gyp rebuild && cpy --flat build/Release/node-av.node binary/ && node scripts/copy-native-to-platform.js",
56
+ "build:tests": "tsc -p tsconfig.tests.json",
57
+ "build:tsc": "rimraf dist && npm run generate:ffmpeg-version && tsc -p tsconfig.build.json && cpy --flat src/api/data/* dist/api/data --parents",
58
+ "clean": "rimraf dist && node-gyp clean && npm run generate && npm run format && npm run lint:fix && npm run build:tests && npm run build:examples && npm run build:tsc",
59
+ "docs:dev": "npm run predocs && vitepress dev docs --port 5173",
60
+ "docs:build": "npm run predocs && rimraf docs/.vitepress/dist && vitepress build docs && cpy --flat docs/logo.png docs/.vitepress/dist",
61
+ "docs:preview": "npm run predocs && vitepress preview docs --port 5174",
62
+ "format": "prettier --write src/ --write test/ --write scripts/ --write examples/ --write benchmarks/ --ignore-unknown --no-error-on-unmatched-pattern",
63
+ "generate": "npm run patch:ffmpeg && npm run generate:ffmpeg-version && npm run generate:constants && npm run generate:encoders && npm run generate:decoders && npm run generate:hardware && npm run generate:layouts && npm run generate:options && npm run generate:format-options && npm run generate:formats && npm run generate:bsf-options && npm run generate:filter-options",
64
+ "generate:ffmpeg-version": "node scripts/generate-ffmpeg-version.js",
65
+ "generate:constants": "cross-env FFMPEG_DEV_PATH=externals/jellyfin-ffmpeg node scripts/generate-constants.js && prettier --write src/constants/constants.ts",
66
+ "generate:encoders": "cross-env FFMPEG_DEV_PATH=externals/jellyfin-ffmpeg node scripts/generate-encoders.js --with-patches && prettier --write src/constants/encoders.ts",
67
+ "generate:decoders": "cross-env FFMPEG_DEV_PATH=externals/jellyfin-ffmpeg node scripts/generate-decoders.js --with-patches && prettier --write src/constants/decoders.ts",
68
+ "generate:hardware": "cross-env FFMPEG_DEV_PATH=externals/jellyfin-ffmpeg node scripts/generate-hardware.js --with-patches && prettier --write src/constants/hardware.ts",
69
+ "generate:layouts": "cross-env FFMPEG_DEV_PATH=externals/jellyfin-ffmpeg node scripts/generate-channel-layouts.js && prettier --write src/constants/channel-layouts.ts",
70
+ "generate:options": "cross-env FFMPEG_DEV_PATH=externals/jellyfin-ffmpeg node scripts/generate-options-source.js && prettier --write src/constants/options.ts",
71
+ "generate:format-options": "cross-env FFMPEG_DEV_PATH=externals/jellyfin-ffmpeg node scripts/generate-format-options.js && prettier --write src/constants/format-options.ts",
72
+ "generate:formats": "cross-env FFMPEG_DEV_PATH=externals/jellyfin-ffmpeg node scripts/generate-formats.js && prettier --write src/constants/formats.ts",
73
+ "generate:bsf-options": "cross-env FFMPEG_DEV_PATH=externals/jellyfin-ffmpeg node scripts/generate-bsf-options.js && prettier --write src/constants/bsf-options.ts",
74
+ "generate:filter-options": "cross-env FFMPEG_DEV_PATH=externals/jellyfin-ffmpeg node scripts/generate-filter-options.js && prettier --write src/constants/filter-options.ts",
75
+ "validate:options": "node scripts/validate-options.js",
76
+ "install": "node install/check.js",
77
+ "install-updates": "npm i --save",
78
+ "lint": "eslint .",
79
+ "lint:fix": "eslint --fix .",
80
+ "lint:gyp": "node scripts/check-gyp-sync.js",
81
+ "patch:ffmpeg": "node scripts/patch-ffmpeg.js",
82
+ "predocs": "typedoc && cpy README.md docs/ --rename=index.md",
83
+ "release:patch": "npm run build:tsc && node scripts/prepare-release.js patch",
84
+ "release:minor": "npm run build:tsc && node scripts/prepare-release.js minor",
85
+ "release:major": "npm run build:tsc && node scripts/prepare-release.js major",
86
+ "release:beta:patch": "npm run build:tsc && node scripts/prepare-release.js beta-patch",
87
+ "release:beta:minor": "npm run build:tsc && node scripts/prepare-release.js beta-minor",
88
+ "release:beta:major": "npm run build:tsc && node scripts/prepare-release.js beta-major",
89
+ "test": "tsx --test --test-reporter=spec --test-reporter-destination=stdout --test-reporter=./test/crash-reporter.ts --test-reporter-destination=stdout test/*.test.ts",
90
+ "test:all": "npm run build:tests && npm run build:tsc && npm test",
91
+ "test:variant": "npm run build:tests && tsx --test test/variant.test.ts",
92
+ "update": "updates --update ./"
93
+ },
94
+ "optionalDependencies": {
95
+ "@seydx/node-av-lgpl-darwin-arm64": "7.1.0-beta.2",
96
+ "@seydx/node-av-lgpl-darwin-x64": "7.1.0-beta.2",
97
+ "@seydx/node-av-lgpl-linux-arm64": "7.1.0-beta.2",
98
+ "@seydx/node-av-lgpl-linux-arm64-musl": "7.1.0-beta.2",
99
+ "@seydx/node-av-lgpl-linux-x64": "7.1.0-beta.2",
100
+ "@seydx/node-av-lgpl-linux-x64-musl": "7.1.0-beta.2",
101
+ "@seydx/node-av-lgpl-win32-arm64-msvc": "7.1.0-beta.2",
102
+ "@seydx/node-av-lgpl-win32-x64-msvc": "7.1.0-beta.2"
103
+ },
104
+ "peerDependencies": {
105
+ "@seydx/node-av-ffmpeg-lgpl": "*",
106
+ "werift": ">=0.24.3"
107
+ },
108
+ "peerDependenciesMeta": {
109
+ "@seydx/node-av-ffmpeg-lgpl": {
110
+ "optional": true
111
+ },
112
+ "werift": {
113
+ "optional": true
114
+ }
115
+ },
116
+ "devDependencies": {
117
+ "@stylistic/eslint-plugin": "^5.10.0",
118
+ "@types/node": "^26.6.6",
119
+ "@types/node-abi": "^3.0.3",
120
+ "@types/semver": "^7.8.0",
121
+ "@types/ws": "^8.18.2",
122
+ "@typescript-eslint/parser": "^8.72.2",
123
+ "concurrently": "^10.0.7",
124
+ "cpy-cli": "^7.0.0",
125
+ "cross-env": "^10.1.0",
126
+ "eslint": "9.39.2",
127
+ "eslint-plugin-jsdoc": "^65.4.6",
128
+ "globals": "^17.14.0",
129
+ "node-addon-api": "^8.9.2",
130
+ "node-gyp": "^13.1.0",
131
+ "prettier": "^3.10.1",
132
+ "rimraf": "^6.1.4",
133
+ "sharp": "^0.35.5",
134
+ "tsx": "^4.23.15",
135
+ "typedoc": "^0.28.20",
136
+ "typedoc-plugin-markdown": "^4.14.1",
137
+ "typedoc-vitepress-theme": "^1.1.4",
138
+ "typescript": "5.9.3",
139
+ "typescript-eslint": "^8.72.2",
140
+ "updates": "^20.0.1",
141
+ "vitepress": "^2.0.0-alpha.21",
142
+ "werift": "^0.27.0",
143
+ "ws": "^8.23.0"
144
+ },
145
+ "bugs": {
146
+ "url": "https://github.com/seydx/node-av/issues"
147
+ },
148
+ "homepage": "https://github.com/seydx/node-av#readme",
149
+ "keywords": [
150
+ "node",
151
+ "ffmpeg",
152
+ "av",
153
+ "libav",
154
+ "bindings",
155
+ "whisper",
156
+ "binary",
157
+ "windows",
158
+ "linux",
159
+ "darwin",
160
+ "x64",
161
+ "arm64",
162
+ "static"
163
+ ],
5
164
  "license": "MIT",
6
- "repository": { "type": "git", "url": "git+https://github.com/seydx/node-av.git" }
165
+ "repository": {
166
+ "type": "git",
167
+ "url": "git+https://github.com/seydx/node-av.git"
168
+ }
7
169
  }