Commit Graph
36 Commits
Author SHA1 Message Date
Vanilagy 1680bd02ad Holistic technical website cleanup 2026-05-03 19:47:39 +02:00
Vanilagy e1dd95086a Add special .node.cjs variant for CJS support 2026-04-28 15:33:51 +02:00
Vanilagy ff46a274b1 Switch back to dynamic import, leave package.json unchanged though 2026-04-28 14:36:48 +02:00
Vanilagy bf9e360587 Revert back to static import of fs, don't like to CJS bundles in package.json 2026-04-28 14:24:58 +02:00
Vanilagy 9a1b8b2602 Add timestampBase option for live MediaStreamTrack sources 2026-04-27 19:38:45 +02:00
Vanilagy c89e7429f7 Fix FilePathSource/FilePathTarget not working in server-side environments using CJS (closes #360) 2026-04-27 18:29:52 +02:00
Vanilagy dfdf7c5648 Make esbuild target es2021 2026-04-27 17:15:40 +02:00
77e70f9090 Add BufferTarget.onFinalize, OutputOptions.onFinalize, ConcurrentRunner (#349)
* Add BufferTarget.onFinalize option for awaitable async action on finalize

The `finalized` event fires synchronously and its return value is ignored,
making it unsuitable for use cases where the muxer should wait (e.g.
uploading the buffer to S3, R2, or other object stores that require a
known Content-Length and therefore can't stream via StreamTarget).

Adds a new `BufferTargetOptions` type with an `onFinalize` callback that
the muxer awaits before resolving. Matches the existing callback pattern
used by `HlsOutputFormatOptions.onSegment`, `onMaster`, etc.

When used with PathedTarget, this provides proper backpressure: the next
segment won't start being produced until the previous one has finished
uploading, keeping memory bounded regardless of video length.

- Adds `BufferTargetOptions` type, exported from the package root
- `BufferTarget` constructor now accepts optional options (backward compatible)
- `_finalize()` awaits `onFinalize` before emitting the `finalized` event
- Adds runtime validation for non-function callbacks
- Updates "Upload to a server" docs in writing-hls.md with S3 pattern
- Documents `onFinalize` in writing-media-files.md BufferTarget section
- Adds tests for callback invocation, async awaiting, backward compat, and validation

* Add ConcurrentRunner, add OutputOptions.onFinalize, adjust docs accordingly, clean up tests

* give me more control baby

* forgot to tell about it

* polish guide and js docs

* vanilagy says remove this, docs will reveal it

---------

Co-authored-by: Vanilagy <[email protected]>
2026-04-17 18:42:09 +02:00
Vanilagy 7080b79a2a Update docs a bunch, fix some typos 2026-04-15 14:36:53 +02:00
Vanilagy 2a2b6450c9 Add better doc blocks, special deprecated logic for API doc generation, add multi-tiered SegmentedInput hydration for reducing file request count, ditch VirtualInputFormat indirection 2026-04-13 17:25:46 +02:00
Vanilagy a15283eaa3 Add @mediabunny/flac-encoder extension, clean up some other code, fix incorrect top-level tsconfig 2026-03-04 21:21:52 +01:00
Vanilagy c4398fb88c Add @mediabunny/aac-encoder extension package 2026-03-04 17:05:34 +01:00
Vanilagy 89afa1e2a6 Make worker_threads dynamic imports direct and keep them in the bundle (externalized), & mark them as ignored for browser builds (fixes #306) 2026-02-24 13:11:16 +01:00
Vanilagy 317193452c Fix Webpack erroring with worker_threads import, unref Worker so process can terminate 2026-02-17 12:34:45 +01:00
Vanilagy a97200f3f0 Add @mediabunny/ac3 extension package 2026-02-12 18:31:59 +01:00
Vanilagy 7e8f9fbbb1 It's 2026 2026-01-16 17:02:12 +01:00
Vanilagy b74854d0a0 Add .js extension even in declaration files 2025-09-29 20:43:40 +02:00
David P.andGitHub fa4e064345 Transparent video read/write support (#145)
* Add support for reading transparent Matroska and implement alpha side data & decode

* Few fixes

* Implement alpha encoding

* Gracefully handle inability to acquire WebGL context, properly clean up WebGL contexts

* Improve touch device detection

* Test test

* Test test #2

* Test test 3

* Test test 4

* Test test 5

* Test test 6

* Test test 7

* Test test 8

* Test test 9

* Test test 10

* Test test 11

* Test test 12

* Test test 13

* Test test 14

* Test test 15

* Test test 16

* Test test 17

* Test test 18

* Test test 19

* Test test 20

* Fix type errors, improve MetadataTags docs

* Do a bunch of docs work

* Test test?

* "Unexpected only modifier 🤓"

* Add InputVideoTrack.canBeTransparent()

* Some clean-up

* Adjust CI to be less spammy in PRs

* Fix broken license headers
2025-09-24 21:20:14 +02:00
Vanilagy 608c769a7e Add explicit disposability to Inputs (#126) 2025-09-21 20:18:59 +02:00
Vanilagy c5523516c7 Add fastStart: 'reserve' option (closes #119) 2025-09-17 12:26:24 +02:00
Vanilagy 555006b9c3 Add improved logic for loading Node.js module (fixes #118) 2025-09-16 21:13:32 +02:00
Vanilagy 1534eb4c40 Lint 2025-09-12 17:26:52 +02:00
Vanilagy 8fb08f1c8e Fix missing @group tag, add doc generation validation to build script 2025-09-12 17:16:12 +02:00
Vanilagy af25bb41ab Add "Used by" references to API docs 2025-09-06 02:29:34 +02:00
Vanilagy 03a9073c40 Fix API generator 2025-09-04 09:38:56 +02:00
Vanilagy a2a30c3e92 Add API doc generator, improve documentation across the board 2025-09-03 18:11:43 +02:00
Vanilagy e5df6f1a63 Add FilePathSource for server-side use 2025-08-30 16:32:14 +02:00
Vanilagy 11c15c2392 Add track-specific conversion options, fix esbuild race condition 2025-08-11 00:00:04 +02:00
Vanilagy cbb2681d33 Create @mediabunny/mp3-encoder, restructure and extend build system 2025-08-10 00:45:30 +02:00
Vanilagy d38ad22559 Big realtime playback refactor
- Added Worker- or AudioContext-based fallbacks in case MediaStreamTrackProcessor is not available
- Fixed fMP4-streamed files not playing in Safari
- Added better error handling for MediaStream sources
- Improved the live recording example to be more robust
2025-07-27 12:13:03 +02:00
Vanilagy 03b4843c1d Fix incorrectly fixed .js imports 2025-07-26 00:50:47 +02:00
Vanilagy 84c9d37cb7 Revise build step and dist structure for better Webpack, CJS and pnpm support 2025-07-09 11:53:19 +02:00
Vanilagy 846fa0b183 Adjust legal comment 2025-06-27 13:22:19 +02:00
Vanilagy a3d73228e2 Add proper license 2025-06-27 13:14:11 +02:00
Vanilagy f675966004 Metamuxer -> Mediabunny 2025-06-16 15:55:38 +02:00
David Payr 3863ffe4d8 Add documentation comments everywhere 2025-03-15 17:12:42 +01:00