Commit Graph
215 Commits
Author SHA1 Message Date
Vanilagy 493ef50820 Add support for SAMPLE-AES and SAMPLE-AES-CTR decryption, add "Common Encryption" support to ISOBMFF demuxer, add InputFormatOptions, rewrite ISOBMFF track codec resolution 2026-04-22 16:54:49 +02:00
Vanilagy 783cfa6fbe Add AppendOnlyStreamSource, adjust examples to use it 2026-04-21 14:58:33 +02:00
Vanilagy 2b3e5f45c6 Remove createInputFrom, changed meaning of PathedSource, add CustomPathedSource 2026-04-21 13:22:10 +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 7d9c063105 Small commit 2026-04-17 09:34:06 +02:00
Vanilagy b85ecd3109 Code review fixes 2026-04-16 17:43:12 +02:00
Vanilagy 6dc4c2d499 More doc adjustments, some type adjustments 2026-04-16 16:19:08 +02:00
Vanilagy 5465602344 Add "Writing HLS" documentation, refine other stuff 2026-04-16 14:53:48 +02:00
Vanilagy 56b25fbdf8 Add onSegmentPopped, add more tests, improve validation, improve M3U8 grammar 2026-04-16 14:48:57 +02:00
Vanilagy d68c9c4fb1 Add M3U8 syntax highlighting in docs 2026-04-15 17:28:06 +02:00
Vanilagy 6a54ad8a5b Add docs for reading HLS 2026-04-15 16:47:54 +02:00
Vanilagy 7080b79a2a Update docs a bunch, fix some typos 2026-04-15 14:36:53 +02:00
Vanilagy c6e505a6fe Make default keyFrameInterval 2 seconds to align with default HLS segment duration 2026-04-13 17:47:48 +02:00
Vanilagy 051578c2ca Remove input track descriptors, add async getters on tracks for everything, deprecate old sync getters 2026-04-10 16:23:17 +02:00
Vanilagy 0813bcab28 Add missing doc blocks for everything, add PathedTarget and PathedSource, few other changes & fixes 2026-04-09 15:22:45 +02:00
Vanilagy b532714926 Merge branch 'main' into hls 2026-04-01 17:20:46 +02:00
Vanilagy e183e5022e Add new sponsors 2026-04-01 17:20:18 +02:00
Vanilagy b06e407d65 Add HLS live mode 2026-03-31 14:13:00 +02:00
Vanilagy cf45c10ff2 Add sponsors! 2026-03-23 11:44:25 +01:00
Vanilagy 587e98391e Merge branch 'main' into hls 2026-03-19 16:52:00 +01:00
31d86331ec FLAC: Add appendOnly option for FlaxMuxer, fix FlacDemuxer reading it (#325)
* implement in FlacOutputFormatOptions

* implement in flac-muxer.ts

* Fix demuxer: Handle minimumFrameSize = 0, maxiumFrameSize = 0

* add a test

* Update flac-demuxer.ts

* Update flac.test.ts

* clean up comments for minima and maxima

* Add FlacOutputFormatOptions.appendOnly to docs

---------

Co-authored-by: Vanilagy <[email protected]>
2026-03-19 13:43:28 +00:00
Vanilagy e42fc85f19 Merge branch 'main' into hls 2026-03-13 17:07:31 +01:00
Vanilagy 93e9c256ab Maybe this helps a little 2026-03-11 16:28:44 +01:00
Vanilagy 05ae21e5ea Add EncodedPacketSink.getFirstKeyPacket() (used to fix #314) 2026-03-09 10:19:01 +01:00
Vanilagy c088a31384 Various fixes 2026-03-06 15:49:24 +01:00
Vanilagy 472dc113e3 Uhm 2026-03-05 19:58:10 +01:00
Vanilagy 66185fed15 Clean up & clarify 2026-03-05 11:49:27 +01: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 bb4749cd8d Add support for reading/writing non-square pixel video frames (fixes #309) 2026-02-25 17:16:33 +01:00
Vanilagy 48f9bda91a Add Tella gold sponsor 2026-02-24 11:07:05 +01:00
Vanilagy 4928779ba1 Add Screen Studio gold sponsor 2026-02-16 21:04:41 +01:00
Vanilagy a97200f3f0 Add @mediabunny/ac3 extension package 2026-02-12 18:31:59 +01:00
Vanilagy 7cc26edacb Add Mediabunny Codec Registry 2026-02-12 11:56:37 +01:00
Vanilagy de9a4bbc23 Update codec soup 2026-02-11 16:03:57 +01:00
Vanilagy 4fae45ec40 Allow negative trim ranges for conversion, add OutputFormat.supportsTimestampedMediaData 2026-02-11 15:56:51 +01:00
417c85d8ed feat(codec): add detection support for AC-3, E-AC-3 audio codecs (#275)
* ac3/eac3 detection

* fix tests

* review pass + follow codebase comments style

* Add ac3/eac3 to docs

* WIP mpeg-2

* Set registration_descriptor

* add support for ac3 system b in mpeg-ts

* Update docs with ac3 in .ts support

* fix formatting

* Remove default to fix linter

* Add eac3 to mpeg-ts

* fix formatting

* Fix failing test

* Refactor AC3/EAC3 code a little

---------

Co-authored-by: Vanilagy <[email protected]>
2026-02-11 15:23:12 +01:00
Vanilagy 612642c5ad Remove sponsor 2026-02-11 08:38:49 +01:00
Vanilagy 2298f4a8b3 Add jepcd sponsor 2026-02-10 17:07:57 +01:00
YonatanandGitHub b61b2b326f Update gling.svg 2026-02-10 16:45:44 +02:00
Vanilagy 172b4a1fd2 Add two new sponsors 2026-02-04 16:54:45 +01:00
David P.andGitHub 43c1ea7efd Merge pull request #292 from fredrikj/parallelism
Add UrlSourceOptions.parallelism
2026-02-03 16:03:55 +01:00
Vanilagy cab92c55ec Fix a few things 2026-02-03 16:01:46 +01:00
Vanilagy f620a328e5 Add ElevenLabs sponsor, bump minor 2026-01-27 14:36:02 +01:00
Vanilagy 7f4093fd43 Add cronischarles-del sponsor 2026-01-23 13:18:10 +01:00
Vanilagy e20f779ede Add InputTrack.number 2026-01-22 09:18:43 +01:00
Vanilagy 277290abe3 Fix tests and elaborate on point in docs 2026-01-19 14:11:02 +01:00
Vanilagy dbaaea255c Expand packet.clone(), make conversion start timestamp default to the input's start timestamp 2026-01-19 14:04:20 +01:00
Vanilagy c3a3eb6abf Merge remote-tracking branch 'origin/main' into mpeg-ts 2026-01-16 21:04:14 +01:00
Vanilagy 3113e449d4 Fix? 2026-01-16 20:55:39 +01:00