@voyagerx/libav.js 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -50,7 +50,7 @@ example of using libav.js from a CDN in the browser thread:
50
50
  <!doctype html>
51
51
  <html>
52
52
  <body>
53
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@libav.js/variant-default@6.4.7/dist/libav-6.4.7.1-default.js"></script>
53
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@libav.js/variant-default@6.8.8/dist/libav-6.8.8.0-default.js"></script>
54
54
  <script type="text/javascript">(async function() {
55
55
  const libav = await LibAV.LibAV({noworker: true});
56
56
  await libav.writeFile("tmp.opus", new Uint8Array(
@@ -73,7 +73,7 @@ Here's a better example, using libav.js locally:
73
73
  <!doctype html>
74
74
  <html>
75
75
  <body>
76
- <script type="text/javascript" src="libav-6.4.7.1-default.js"></script>
76
+ <script type="text/javascript" src="libav-6.8.8.0-default.js"></script>
77
77
  <script type="text/javascript">(async function() {
78
78
  const libav = await LibAV.LibAV();
79
79
  await libav.writeFile("tmp.opus", new Uint8Array(
@@ -161,7 +161,10 @@ released version, it is sufficient to provide the `sources` directory.
161
161
 
162
162
  libav.js is published to NPM as `libav.js`, and each released variant is
163
163
  published in a much smaller NPM package as `@libav.js/variant-<variant>`. The
164
- CDN example above uses the `@libav.js/variant-default` package, for example.
164
+ CDN example above uses the `@libav.js/variant-default` package, for example. The
165
+ `@libav.js/types` package is also provided with only the types (`.d.ts` file),
166
+ and if using TypeScript, you are highly recommended to use it, to avoid bringing
167
+ entire variants in as dependencies of your own packages.
165
168
 
166
169
  ### Why the version number in the filenames?
167
170
 
@@ -307,6 +310,30 @@ default version unless you have some specific compatibility issue that forces
307
310
  you to use a different version.
308
311
 
309
312
 
313
+ ## Modular variants
314
+
315
+ In addition to the variants described above, a large number of modular variants
316
+ are provided, each of which is sufficient for demuxing exactly one format, or
317
+ decoding exactly one codec. The purpose of these modular variants is to make it
318
+ easy to support every conceivable input file without making a massive
319
+ monolithic build of libav.js.
320
+
321
+ The modular variants are not available in NPM. Instead, most are provided in
322
+ releases on GitHub with the suffix `-modular`. This release does not include
323
+ popular reprobate codecs; you will need to build them yourself if you need
324
+ them.
325
+
326
+ Demuxer variants are named `demuxer-<format>`, e.g. `demuxer-matroska` and
327
+ `demuxer-mp4`. Decoder variants are named `decoder-<codec>`, e.g.
328
+ `decoder-opus` and `decoder-aac`. Each provides *only* functions related to
329
+ demuxing or decoding, respectively.
330
+
331
+ The modular variants are best paired with
332
+ [AVGuesser](https://github.com/Yahweasel/AVGuesser) and
333
+ [TransAVormer](https://github.com/Yahweasel/transavormer), as loading multiple
334
+ variants on demand is complicated.
335
+
336
+
310
337
  ## Size
311
338
 
312
339
  FFmpeg is big, so libav.js is big. But, it's not ludicrous; the WebAssembly is
@@ -314,12 +341,17 @@ usually between 1.5 and 3 MiB for fairly complete builds, and the asm.js is abou
314
341
  double that.
315
342
 
316
343
  You can estimate the size of variants based on the size of the constituent
317
- fragments. As of version 5.0.6.1.1, an empty build is approximately 589KiB
344
+ fragments. As of version 6.8.8.0, an empty build is approximately 178KiB
318
345
  (WebAssembly). The sizes of each additional fragment can be found in
319
346
  [fragment-sizes.csv](docs/fragment-sizes.csv). The data in that CSV file can be
320
347
  recreated by `tools/fragment-sizes.sh`, but note that the CSV file in the
321
348
  repository is after further processing (in particular, normalizing to KiB and
322
- subtracting away the empty size).
349
+ subtracting away the empty and sizes). Note that the library columns show
350
+ dependencies: for example, the `decoder-libopus` fragment depends on the
351
+ `avcodec` fragment (since it's a codec), and the `1` in the `avcodec` column
352
+ tells you that that dependency exists; a build with just `decoder-libopus` will
353
+ take approximately the empty size, plus the fragment size of `avcodec`, plus the
354
+ fragment size of `decoder-libopus`.
323
355
 
324
356
  The asm.js versions are much bigger, but will not be loaded on
325
357
  WebAssembly-capable clients.
@@ -372,6 +404,13 @@ connect it to WebCodecs:
372
404
  decoding, or WebCodecs for encoding and libav.js for muxing. Of course, the
373
405
  WebCodecs used with the bridge can easily be the polyfill if needed.
374
406
 
407
+ In addition, a frontend library was created to bring together all of these
408
+ projects and provide a single frontend for media transformation on a browser:
409
+
410
+ * [TransAVormer](https://github.com/Yahweasel/transavormer) is a stream-based
411
+ frontend for libav.js and WebCodecs for anything-to-anything transformation
412
+ of digital media data.
413
+
375
414
 
376
415
  ## Bundlers
377
416