Commit Graph
145 Commits
Author SHA1 Message Date
Vanilagy 0cdf0063e2 Add VideoSample.encodeOptions, optimized ArrayBuffer-backed VideoSample cloning 2026-06-02 18:01:22 +02:00
Vanilagy ebfb1e6d75 Add MediabunnyServerOptions and configurable hardware context (closes #389) 2026-06-02 16:28:47 +02:00
Vanilagy 05f8ecd908 Respect Range header for UrlSource (#387) 2026-06-02 11:05:46 +02:00
Vanilagy c6c768d93e Omit 'signal', clarify docs for reading ranged resources (#387) 2026-06-01 22:00:39 +02:00
Igor Samokhovets b82ccc2c6a Document UrlSource RequestInit overrides 2026-05-25 11:12:41 +02:00
Vanilagy 441eea38b9 CustomSource -> StreamSource 2026-05-24 15:48:01 +02:00
Vanilagy 1c6c8c5217 Add missing stuff in docs 2026-05-13 20:03:46 +02:00
Vanilagy 14c534ed00 Polish docs 2026-05-13 15:44:09 +02:00
Vanilagy 1680bd02ad Holistic technical website cleanup 2026-05-03 19:47:39 +02:00
Vanilagy f3dec587fd Make FLAC encoder bit depth depend on input sample format, add sampleFormat audio transformation option, fix incorrect bitrate validation for FLAC (closes #357) 2026-04-29 16:27:20 +02:00
Vanilagy aa4966a5f1 Update codec soup and docs 2026-04-28 14:41:20 +02:00
Vanilagy 6182af7c29 Add HLS transcoding example 2026-04-28 13:54:42 +02:00
Vanilagy 0f6c374750 Ensure extensions work with huge timestamps, fix AC3 and AAC extension's behavior with huge timestamps 2026-04-27 20:58:05 +02:00
Vanilagy 5ee78c6480 Add pssh box parsing and expose them in resolveKey 2026-04-24 19:01:25 +02:00
Vanilagy 1d6731e4f6 Add blog, add HLS blog post 2026-04-24 17:37:49 +02:00
Vanilagy 7acae8dda1 Add a track disposition section to Writing HLS 2026-04-23 11:06:50 +02:00
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 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 b06e407d65 Add HLS live mode 2026-03-31 14:13:00 +02: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 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 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 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 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 cab92c55ec Fix a few things 2026-02-03 16:01:46 +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 20e4610da4 Document MPEG-TS 2026-01-16 20:51:27 +01:00
Vanilagy 888441232d Implement the bulk of the MPEG-TS demuxer, add a bunch of tests, and a few other things 2026-01-14 12:05:39 +01:00
Vanilagy 2ab1be3834 Add maximumPageDuration Ogg muxer option (closes #277) 2026-01-13 13:37:34 +01:00