node-av-lgpl 0.0.0 → 7.1.0-beta.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 (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 +383 -0
  283. package/dist/lib/stream.js +524 -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,624 @@
1
+ var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
2
+ if (value !== null && value !== void 0) {
3
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
4
+ var dispose, inner;
5
+ if (async) {
6
+ if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
7
+ dispose = value[Symbol.asyncDispose];
8
+ }
9
+ if (dispose === void 0) {
10
+ if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
11
+ dispose = value[Symbol.dispose];
12
+ if (async) inner = dispose;
13
+ }
14
+ if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
15
+ if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
16
+ env.stack.push({ value: value, dispose: dispose, async: async });
17
+ }
18
+ else if (async) {
19
+ env.stack.push({ async: true });
20
+ }
21
+ return value;
22
+ };
23
+ var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
24
+ return function (env) {
25
+ function fail(e) {
26
+ env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
27
+ env.hasError = true;
28
+ }
29
+ var r, s = 0;
30
+ function next() {
31
+ while (r = env.stack.pop()) {
32
+ try {
33
+ if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
34
+ if (r.dispose) {
35
+ var result = r.dispose.call(r.value);
36
+ if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
37
+ }
38
+ else s |= 1;
39
+ }
40
+ catch (e) {
41
+ fail(e);
42
+ }
43
+ }
44
+ if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
45
+ if (env.hasError) throw env.error;
46
+ }
47
+ return next();
48
+ };
49
+ })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
50
+ var e = new Error(message);
51
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
52
+ });
53
+ import { AVCOL_RANGE_MPEG, AV_CODEC_CAP_EXPERIMENTAL, AV_CODEC_CAP_HARDWARE, AV_CODEC_ID_HEVC, AV_HWDEVICE_TYPE_CUDA, AV_HWDEVICE_TYPE_D3D11VA, AV_HWDEVICE_TYPE_DRM, AV_HWDEVICE_TYPE_DXVA2, AV_HWDEVICE_TYPE_OPENCL, AV_HWDEVICE_TYPE_VAAPI, AV_HWDEVICE_TYPE_VDPAU, AV_HWDEVICE_TYPE_VIDEOTOOLBOX, AV_LOG_WARNING, AV_PIX_FMT_NV12, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P, } from '../../constants/constants.js';
54
+ import { Codec } from '../../lib/codec.js';
55
+ import { Filter } from '../../lib/filter.js';
56
+ import { Frame } from '../../lib/frame.js';
57
+ import { Log } from '../../lib/log.js';
58
+ import { Rational } from '../../lib/rational.js';
59
+ import { avGetPixFmtName, avIsHardwarePixelFormat } from '../../lib/utilities.js';
60
+ import { Decoder } from '../decoder.js';
61
+ import { Encoder } from '../encoder.js';
62
+ import { FilterPreset } from '../filter-presets.js';
63
+ import { FilterAPI } from '../filter.js';
64
+ import { pickSupportedPixelFormat } from './codec-format.js';
65
+ import { resolveScaleSize } from './scale-size.js';
66
+ /**
67
+ * Devices whose upload and scaler are proven together; elsewhere software frames are scaled on the CPU.
68
+ *
69
+ * @internal
70
+ */
71
+ const UPLOAD_SCALE_DEVICES = [AV_HWDEVICE_TYPE_VAAPI, AV_HWDEVICE_TYPE_CUDA, AV_HWDEVICE_TYPE_VIDEOTOOLBOX];
72
+ /**
73
+ * Devices without encoders of their own, they borrow one from a GPU vendor.
74
+ *
75
+ * @internal
76
+ */
77
+ const BORROWING_DEVICES = [
78
+ AV_HWDEVICE_TYPE_D3D11VA,
79
+ AV_HWDEVICE_TYPE_DXVA2,
80
+ AV_HWDEVICE_TYPE_OPENCL,
81
+ AV_HWDEVICE_TYPE_VDPAU,
82
+ AV_HWDEVICE_TYPE_DRM,
83
+ ];
84
+ /**
85
+ * The vendor encoders such a device borrows, in the order {@link HardwareContext.getEncoderCodec} looks for them.
86
+ *
87
+ * @internal
88
+ */
89
+ const VENDOR_ENCODERS = ['nvenc', 'qsv', 'amf'];
90
+ /**
91
+ * How long a hardware encoder that failed its test stays passed over, a busy GPU can recover.
92
+ *
93
+ * @internal
94
+ */
95
+ const FAILED_PROBE_RETRY_MS = 60_000;
96
+ /**
97
+ * Size of the test frame a hardware encoder has to encode, when the caller names none.
98
+ *
99
+ * @internal
100
+ */
101
+ const PROBE_SIZE = { width: 640, height: 360 };
102
+ /**
103
+ * Test encodes per device and encoder, failures with the time they failed.
104
+ *
105
+ * @internal
106
+ */
107
+ const encoderProbes = new Map();
108
+ /**
109
+ * No scaler and no upload for scaling, the graph of a device whose filters failed.
110
+ *
111
+ * @internal
112
+ */
113
+ const NO_DEVICE_FILTERS = { scaler: false, upload: false };
114
+ /**
115
+ * Filters per device type, the build decides which exist.
116
+ *
117
+ * @internal
118
+ */
119
+ const deviceFilterCache = new Map();
120
+ /**
121
+ * Build the filter graph that brings a decoded frame to the video encoder of a transcode.
122
+ *
123
+ * Frames stay on the device whenever the encoder takes them there, and scaling
124
+ * and format conversion run on the device whenever it has a scaler. Hardware
125
+ * encoders get 8-bit 4:2:0 in NV12: VAAPI decodes JPEG into planar or 4:2:2
126
+ * surfaces and 10-bit sources come as P010, which H.264 hardware encoders reject.
127
+ * Software encoders get yuv420p when the frames have to be converted anyway, it
128
+ * is the layout every browser and HomeKit decodes (unlike the 4:2:2 profile x264
129
+ * picks for a 4:2:2 JPEG camera). Packed sources such as yuyv422 are converted
130
+ * too, swscale cannot scale them in place.
131
+ *
132
+ * Decided per frame, not per stream: a hardware decoder falls back to software
133
+ * frames for input it cannot handle, e.g. 4:2:2 JPEG on NVDEC.
134
+ *
135
+ * @param input - The frame
136
+ *
137
+ * @param target - The encoder's needs
138
+ *
139
+ * @param filters - What the target's device has, see {@link findDeviceFilters}
140
+ *
141
+ * @returns The filter description, `null` when the frame can go to the encoder as it is
142
+ *
143
+ * @internal
144
+ */
145
+ export function videoTranscodeGraph(input, target, filters) {
146
+ const { encoder, hardware } = target;
147
+ const size = resolveScaleSize(input.width, input.height, target.width, target.height);
148
+ const parts = [];
149
+ let resize = size.width !== input.width || size.height !== input.height;
150
+ let format = input.format;
151
+ // a frame dropped first costs no later stage anything
152
+ if (target.fps !== undefined)
153
+ parts.push(`fps=${target.fps}`);
154
+ const takesDevice = !!hardware && encoderTakesDevice(encoder, hardware);
155
+ if (input.hw) {
156
+ if (input.onDevice && filters.scaler) {
157
+ // the scaler converts in the same pass, and a software encoder gets NV12 downloaded
158
+ if (resize || format !== AV_PIX_FMT_NV12)
159
+ parts.push(deviceScale(hardware, resize ? size : undefined));
160
+ if (takesDevice)
161
+ return finish(parts);
162
+ parts.push('hwdownload', 'format=nv12');
163
+ format = AV_PIX_FMT_NV12;
164
+ resize = false;
165
+ }
166
+ else if (input.onDevice && takesDevice && !resize && format === AV_PIX_FMT_NV12) {
167
+ return finish(parts);
168
+ }
169
+ else {
170
+ parts.push('hwdownload', `format=${pixFmtName(format)}`);
171
+ }
172
+ }
173
+ // software frames from here on
174
+ const softwareFormat = encoderSoftwareFormat(encoder);
175
+ if (hardware && (softwareFormat === null || (takesDevice && resize && filters.upload && filters.scaler))) {
176
+ // the encoder takes device frames only, or the device scales cheaper than the CPU
177
+ const scaleOnDevice = resize && filters.scaler;
178
+ if (resize && !scaleOnDevice)
179
+ parts.push(`scale=${size.width}:${size.height}`);
180
+ parts.push('format=nv12', FilterPreset.chain(hardware).hwupload().build());
181
+ if (scaleOnDevice)
182
+ parts.push(deviceScale(hardware, size));
183
+ return finish(parts);
184
+ }
185
+ if (resize)
186
+ parts.push(`scale=${size.width}:${size.height}`);
187
+ if (resize || !takesAsIs(encoder, format))
188
+ parts.push(`format=${pixFmtName(softwareFormat ?? AV_PIX_FMT_NV12)}`);
189
+ return finish(parts);
190
+ }
191
+ /**
192
+ * Describe a decoded frame for {@link videoTranscodeGraph}.
193
+ *
194
+ * @param frame - The frame
195
+ *
196
+ * @param hardware - The transcode's device, if any
197
+ *
198
+ * @returns Where the frame lives, its format and size
199
+ *
200
+ * @internal
201
+ */
202
+ export function describeVideoFrame(frame, hardware) {
203
+ const hw = frame.isHwFrame();
204
+ return {
205
+ hw,
206
+ onDevice: hw && !!hardware && frame.format === hardware.devicePixelFormat,
207
+ format: hw ? (frame.hwFramesCtx?.swFormat ?? AV_PIX_FMT_NV12) : frame.format,
208
+ width: frame.width,
209
+ height: frame.height,
210
+ };
211
+ }
212
+ /**
213
+ * Create the filter between the video decoder (or frame source) and the encoder of a transcode.
214
+ *
215
+ * The graph is built by {@link videoTranscodeGraph} from the first frame and
216
+ * again whenever the frames change, e.g. when the decoder falls back to software.
217
+ * A graph whose device filters fail to configure is replaced by one that
218
+ * converts in software.
219
+ *
220
+ * @param target - The encoder's needs
221
+ *
222
+ * @param filters - The device's filters, found by default
223
+ *
224
+ * @returns The filter
225
+ *
226
+ * @internal
227
+ */
228
+ export function createVideoTranscodeFilter(target, filters = findDeviceFilters(target.hardware)) {
229
+ return FilterAPI.create((frame, failure) => {
230
+ const input = describeVideoFrame(frame, target.hardware);
231
+ if (!failure) {
232
+ return videoTranscodeGraph(input, target, filters);
233
+ }
234
+ Log.log(AV_LOG_WARNING, `Video filters on ${target.hardware?.deviceTypeName ?? 'the CPU'} failed (${failure.message}), converting in software\n`);
235
+ return videoTranscodeGraph(input, target, NO_DEVICE_FILTERS);
236
+ }, { hardware: target.hardware });
237
+ }
238
+ /**
239
+ * Open the video decoder of a transcode, on the device unless it fails to open there.
240
+ *
241
+ * A device decoder that opens but then produces nothing moves to software on
242
+ * its own ({@link DecoderOptions.hardwareFallback}).
243
+ *
244
+ * @param stream - The video stream
245
+ *
246
+ * @param hardware - The device to decode on, if any
247
+ *
248
+ * @param options - Decoder options besides the device
249
+ *
250
+ * @returns The decoder
251
+ *
252
+ * @throws {FFmpegError} If no software decoder opens either
253
+ *
254
+ * @internal
255
+ */
256
+ export async function openTranscodeDecoder(stream, hardware, options) {
257
+ if (hardware) {
258
+ try {
259
+ return await Decoder.create(stream, { ...options, hardware, hardwareFallback: true });
260
+ }
261
+ catch (error) {
262
+ Log.log(AV_LOG_WARNING, `Video decoder failed to open on ${hardware.deviceTypeName}, decoding in software: ${error.message}\n`);
263
+ }
264
+ }
265
+ return await Decoder.create(stream, options);
266
+ }
267
+ /**
268
+ * Set the video bitrate on the encoder context.
269
+ *
270
+ * Sets the target bitrate together with a VBV cap (maxrate + a 1s buffer).
271
+ * Encoder.create() always seeds a default target bitrate (1 Mbps for video),
272
+ * so the target MUST be set along with the cap, a cap above the seeded target
273
+ * changes nothing. Without a bitrate the target follows the picture size and
274
+ * frame rate, see {@link defaultVideoBitrate}.
275
+ *
276
+ * @param ctx - Encoder codec context
277
+ *
278
+ * @param bitrate - Maximum bitrate in bits per second, or undefined
279
+ *
280
+ * @internal
281
+ */
282
+ export function applyVideoBitrate(ctx, bitrate) {
283
+ const rate = Math.round(bitrate && bitrate > 0 ? bitrate : defaultVideoBitrate(ctx));
284
+ ctx.bitRate = BigInt(rate);
285
+ ctx.rcMaxRate = BigInt(rate);
286
+ ctx.rcBufferSize = rate;
287
+ }
288
+ /**
289
+ * A bitrate that encodes the picture without blocking.
290
+ *
291
+ * Scales with the picture size and frame rate the encoder opens with, so a
292
+ * transcode that only changes the codec keeps the quality of the source.
293
+ * HEVC needs about 40% fewer bits than H.264 for the same picture.
294
+ *
295
+ * @param ctx - Encoder codec context with size and timing set
296
+ *
297
+ * @returns Bitrate in bits per second
298
+ *
299
+ * @internal
300
+ */
301
+ function defaultVideoBitrate(ctx) {
302
+ // without a frame rate the encoder reads the inverse time base as one
303
+ const rate = ctx.framerate.num > 0 ? ctx.framerate : new Rational(ctx.timeBase.den, ctx.timeBase.num);
304
+ const bitsPerPixel = ctx.codecId === AV_CODEC_ID_HEVC ? 0.06 : 0.1;
305
+ return ctx.width * ctx.height * (rate.num / rate.den) * bitsPerPixel;
306
+ }
307
+ /**
308
+ * Find the software encoder for a codec.
309
+ *
310
+ * FFmpeg picks the first encoder registered for a codec. The Linux arm64
311
+ * builds register the Rockchip MPP encoders ahead of libx264 and libx265, and
312
+ * those fail to open on every other arm64 machine, e.g. a Raspberry Pi.
313
+ *
314
+ * @param codecId - The codec to encode
315
+ *
316
+ * @returns The first encoder for the codec that is no hardware encoder, FFmpeg's pick when there is none
317
+ *
318
+ * @internal
319
+ */
320
+ export function findSoftwareEncoder(codecId) {
321
+ let opaque = null;
322
+ let result;
323
+ while ((result = Codec.iterateCodecs(opaque))) {
324
+ const { codec } = result;
325
+ if (codec.isEncoder() && codec.id === codecId && !codec.hasCapabilities(AV_CODEC_CAP_HARDWARE) && !codec.hasCapabilities(AV_CODEC_CAP_EXPERIMENTAL)) {
326
+ return codec;
327
+ }
328
+ opaque = result.opaque;
329
+ }
330
+ return Codec.findEncoder(codecId);
331
+ }
332
+ /**
333
+ * Find the device's encoder for a codec, if it works on this machine.
334
+ *
335
+ * @param hardware - The device, if any
336
+ *
337
+ * @param codec - The codec to encode
338
+ *
339
+ * @param options - Encoder options the encoder will get, some drivers need them to open (e.g. `low_power`)
340
+ *
341
+ * @param size - The size it will encode, hardware encoders have a maximum that differs per GPU
342
+ *
343
+ * @param size.width - Width
344
+ *
345
+ * @param size.height - Height
346
+ *
347
+ * @returns The hardware encoder, or null to encode in software
348
+ *
349
+ * @internal
350
+ */
351
+ export async function findUsableHardwareEncoder(hardware, codec, options, size) {
352
+ const encoder = hardware?.getEncoderCodec(codec);
353
+ if (!encoder || !hardware) {
354
+ return null;
355
+ }
356
+ for (const candidate of encoderCandidates(encoder, hardware)) {
357
+ if (await canEncodeOnDevice(candidate, hardware, options, size)) {
358
+ return candidate;
359
+ }
360
+ }
361
+ return null;
362
+ }
363
+ /**
364
+ * The encoders to try for a device, the one it names first.
365
+ *
366
+ * A device without encoders of its own names the first vendor encoder the
367
+ * build has, NVENC on every Windows build. On an AMD or Intel GPU that one
368
+ * cannot work but the vendor's own can.
369
+ *
370
+ * @param encoder - The encoder the device names
371
+ *
372
+ * @param hardware - The device
373
+ *
374
+ * @returns The encoders in the order to try them
375
+ *
376
+ * @internal
377
+ */
378
+ function encoderCandidates(encoder, hardware) {
379
+ const name = encoder.name;
380
+ if (!name || !BORROWING_DEVICES.includes(hardware.deviceType)) {
381
+ return [encoder];
382
+ }
383
+ const base = name.slice(0, name.lastIndexOf('_'));
384
+ const others = VENDOR_ENCODERS.map((vendor) => Codec.findEncoderByName(`${base}_${vendor}`)).filter((candidate) => !!candidate?.isHardwareAcceleratedEncoder() && candidate.name !== name);
385
+ return [encoder, ...others];
386
+ }
387
+ /**
388
+ * Check whether a hardware encoder works on this machine, by encoding a test frame once.
389
+ *
390
+ * Finding an encoder says nothing about the driver: NVENC refuses to open
391
+ * when the driver is older than the API it was built against, many GPUs have
392
+ * no encoder at all. A failed encoder is passed over for a minute, then tried
393
+ * again. Concurrent callers share one test.
394
+ *
395
+ * @param encoder - The hardware encoder
396
+ *
397
+ * @param hardware - The device it encodes on
398
+ *
399
+ * @param options - Encoder options the encoder will get
400
+ *
401
+ * @param size - Size of the test frame
402
+ *
403
+ * @param size.width - Width
404
+ *
405
+ * @param size.height - Height
406
+ *
407
+ * @returns Whether it encoded the frame
408
+ *
409
+ * @internal
410
+ */
411
+ export async function canEncodeOnDevice(encoder, hardware, options, size = PROBE_SIZE) {
412
+ const settings = JSON.stringify(options ?? {}, (_key, value) => (typeof value === 'bigint' ? String(value) : value));
413
+ const key = `${hardware.deviceTypeName}:${encoder.name}:${size.width}x${size.height}:${settings}`;
414
+ const known = encoderProbes.get(key);
415
+ if (known && (known.failedAt === undefined || Date.now() - known.failedAt < FAILED_PROBE_RETRY_MS)) {
416
+ return known.usable;
417
+ }
418
+ const probe = { usable: probeEncoder(encoder, hardware, options, size) };
419
+ encoderProbes.set(key, probe);
420
+ const usable = await probe.usable;
421
+ if (!usable) {
422
+ probe.failedAt = Date.now();
423
+ Log.log(AV_LOG_WARNING, `Hardware encoder ${encoder.name} failed to encode a ${size.width}x${size.height} test frame on ${hardware.deviceTypeName}, encoding video in software\n`);
424
+ }
425
+ return usable;
426
+ }
427
+ /**
428
+ * Encode one frame with a hardware encoder.
429
+ *
430
+ * @param codec - The hardware encoder
431
+ *
432
+ * @param hardware - The device it encodes on
433
+ *
434
+ * @param options - Encoder options
435
+ *
436
+ * @param size - Size of the test frame
437
+ *
438
+ * @param size.width - Width
439
+ *
440
+ * @param size.height - Height
441
+ *
442
+ * @returns Whether a packet came out
443
+ *
444
+ * @internal
445
+ */
446
+ async function probeEncoder(codec, hardware, options, size) {
447
+ try {
448
+ const env_1 = { stack: [], error: void 0, hasError: false };
449
+ try {
450
+ const frame = __addDisposableResource(env_1, Frame.fromVideoBuffer(Buffer.alloc((size.width * size.height * 3) / 2), {
451
+ width: size.width,
452
+ height: size.height,
453
+ format: AV_PIX_FMT_NV12,
454
+ timeBase: { num: 1, den: 25 },
455
+ pts: 0n,
456
+ }), false);
457
+ // an unset range makes some encoders warn
458
+ frame.colorRange = AVCOL_RANGE_MPEG;
459
+ const upload = __addDisposableResource(env_1, encoderSoftwareFormat(codec) === null ? FilterAPI.create(FilterPreset.chain(hardware).hwupload().build(), { hardware }) : undefined, false);
460
+ const encoder = __addDisposableResource(env_1, await Encoder.create(codec, {
461
+ maxBFrames: 0,
462
+ options,
463
+ configure: (context) => {
464
+ context.framerate = new Rational(25, 1);
465
+ },
466
+ }), false);
467
+ const inputs = upload ? await upload.processAll(frame) : [frame];
468
+ let packets = 0;
469
+ try {
470
+ for (const input of inputs) {
471
+ for (const packet of await encoder.encodeAll(input)) {
472
+ packets++;
473
+ packet.free();
474
+ }
475
+ }
476
+ }
477
+ finally {
478
+ if (upload)
479
+ inputs.forEach((input) => input.free());
480
+ }
481
+ for await (const _packet_1 of encoder.flushPackets()) {
482
+ const env_2 = { stack: [], error: void 0, hasError: false };
483
+ try {
484
+ const _packet = __addDisposableResource(env_2, _packet_1, false);
485
+ packets++;
486
+ }
487
+ catch (e_1) {
488
+ env_2.error = e_1;
489
+ env_2.hasError = true;
490
+ }
491
+ finally {
492
+ __disposeResources(env_2);
493
+ }
494
+ }
495
+ return packets > 0;
496
+ }
497
+ catch (e_2) {
498
+ env_1.error = e_2;
499
+ env_1.hasError = true;
500
+ }
501
+ finally {
502
+ __disposeResources(env_1);
503
+ }
504
+ }
505
+ catch {
506
+ return false;
507
+ }
508
+ }
509
+ /**
510
+ * Whether an encoder takes the frames of a device as they are.
511
+ *
512
+ * @param encoder - The encoder
513
+ *
514
+ * @param hardware - The device
515
+ *
516
+ * @returns True for a hardware encoder that lists the device's pixel format
517
+ *
518
+ * @internal
519
+ */
520
+ function encoderTakesDevice(encoder, hardware) {
521
+ return encoder.isHardwareAcceleratedEncoder() && (encoder.pixelFormats?.includes(hardware.devicePixelFormat) ?? false);
522
+ }
523
+ /**
524
+ * The software format to convert frames to for an encoder.
525
+ *
526
+ * @param encoder - The encoder
527
+ *
528
+ * @returns NV12 for hardware encoders and yuv420p for software ones when listed,
529
+ * otherwise the closest listed software format; `null` if it takes device frames only
530
+ *
531
+ * @internal
532
+ */
533
+ function encoderSoftwareFormat(encoder) {
534
+ const formats = encoder.pixelFormats;
535
+ if (!formats || formats.length === 0)
536
+ return AV_PIX_FMT_YUV420P;
537
+ const preferred = encoder.isHardwareAcceleratedEncoder() ? [AV_PIX_FMT_NV12, AV_PIX_FMT_YUV420P] : [AV_PIX_FMT_YUV420P, AV_PIX_FMT_NV12];
538
+ const listed = preferred.find((format) => formats.includes(format));
539
+ if (listed !== undefined)
540
+ return listed;
541
+ const software = formats.filter((format) => !avIsHardwarePixelFormat(format));
542
+ return software.length > 0 ? pickSupportedPixelFormat(AV_PIX_FMT_YUV420P, software) : null;
543
+ }
544
+ /**
545
+ * Whether an encoder takes a software frame without conversion.
546
+ *
547
+ * @param encoder - The encoder
548
+ *
549
+ * @param format - The frame's pixel format
550
+ *
551
+ * @returns True for 8-bit 4:2:0 the encoder lists
552
+ *
553
+ * @internal
554
+ */
555
+ function takesAsIs(encoder, format) {
556
+ const is420 = format === AV_PIX_FMT_YUV420P || format === AV_PIX_FMT_YUVJ420P || format === AV_PIX_FMT_NV12;
557
+ return is420 && (encoder.pixelFormats?.includes(format) ?? true);
558
+ }
559
+ /**
560
+ * The device scaler converting to NV12, scaling too when given a size.
561
+ *
562
+ * @param hardware - The device
563
+ *
564
+ * @param size - Output size, if it changes
565
+ *
566
+ * @param size.width - Output width
567
+ *
568
+ * @param size.height - Output height
569
+ *
570
+ * @returns The filter
571
+ *
572
+ * @internal
573
+ */
574
+ function deviceScale(hardware, size) {
575
+ const chain = FilterPreset.chain(hardware);
576
+ return (size ? chain.scale(size.width, size.height, { format: 'nv12' }) : chain.scaleFormat(AV_PIX_FMT_NV12)).build();
577
+ }
578
+ /**
579
+ * Find out which transcode filters a device has in this FFmpeg build.
580
+ *
581
+ * @param hardware - The device, if any
582
+ *
583
+ * @returns Its filters, none without a device
584
+ *
585
+ * @internal
586
+ */
587
+ export function findDeviceFilters(hardware) {
588
+ if (!hardware)
589
+ return NO_DEVICE_FILTERS;
590
+ let filters = deviceFilterCache.get(hardware.deviceType);
591
+ if (!filters) {
592
+ const exists = (description) => Filter.getByName(description.split('=')[0]) !== null;
593
+ const scaler = FilterPreset.chain(hardware).supports('scale') && exists(FilterPreset.chain(hardware).scaleFormat(AV_PIX_FMT_NV12).build());
594
+ const upload = UPLOAD_SCALE_DEVICES.includes(hardware.deviceType) && exists(FilterPreset.chain(hardware).hwupload().build());
595
+ filters = { scaler, upload };
596
+ deviceFilterCache.set(hardware.deviceType, filters);
597
+ }
598
+ return filters;
599
+ }
600
+ /**
601
+ * Join the filters of a graph.
602
+ *
603
+ * @param parts - The filters
604
+ *
605
+ * @returns The description, `null` for none
606
+ *
607
+ * @internal
608
+ */
609
+ function finish(parts) {
610
+ return parts.length > 0 ? parts.join(',') : 'null';
611
+ }
612
+ /**
613
+ * Name of a pixel format for a filter description.
614
+ *
615
+ * @param format - The pixel format
616
+ *
617
+ * @returns Its name
618
+ *
619
+ * @internal
620
+ */
621
+ function pixFmtName(format) {
622
+ return avGetPixFmtName(format) ?? 'nv12';
623
+ }
624
+ //# sourceMappingURL=video-transcode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-transcode.js","sourceRoot":"","sources":["../../../src/api/utilities/video-transcode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACt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