Commit Graph
966 Commits
Author SHA1 Message Date
David P.andGitHub 3e70e8912b Merge pull request #291 from Vanilagy/hls
HLS read/write support
2026-04-28 10:09:24 +02:00
Vanilagy a3aa6a69ac Add use case 2026-04-28 10:04:14 +02:00
Vanilagy 105a7dda2f Move it forward 2026-04-27 21:02:59 +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 0cc564b47a Bump to beta 8 v1.42.0-beta.8 2026-04-27 19:47:27 +02:00
Vanilagy 57b265b897 They were indeed temp 2026-04-27 19:46:06 +02:00
Vanilagy 631d207ca2 Clarify 2026-04-27 19:41:59 +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 15beb69137 Update convert.html 2026-04-27 17:58:55 +02:00
Vanilagy dfdf7c5648 Make esbuild target es2021 2026-04-27 17:15:40 +02:00
Vanilagy cf8cea2957 Fix attribute parsing bug 2026-04-27 17:12:28 +02:00
Vanilagy 0e721daefd Bump to beta 7 v1.42.0-beta.7 2026-04-24 20:58:26 +02:00
Vanilagy 9fdf263482 Merge branch 'main' into hls 2026-04-24 20:56:59 +02:00
Vanilagy bcde2770d1 Add null terminator to TXXX 2026-04-24 20:55:34 +02:00
Vanilagy b285360563 Sussy CI v1.41.0 2026-04-24 19:45:39 +02:00
Vanilagy 5e491eb0f9 Bump minor 2026-04-24 19:43:11 +02:00
Vanilagy 97f6b35cda Add special TXXX handling for ID3v2 2026-04-24 19:42:15 +02:00
Vanilagy 1ca3e48f48 Fix? 2026-04-24 19:06:45 +02:00
Vanilagy 5f8978271e Clarify 2026-04-24 19:02:35 +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 66997ddd16 Fix file compression example, add processedTime parameter to onProgress for Conversion API 2026-04-24 14:33:19 +02:00
Vanilagy 9de93877bd Bump to beta 6 v1.42.0-beta.6 2026-04-23 16:14:24 +02:00
Vanilagy 8809bb311b Remove this 2026-04-23 14:47:48 +02:00
b05cdbe7e0 fix: two long-running HLS transcode issues (#355)
* fix: release targets from Output._targets on finalize

Long-running HLS transcodes leak memory. Every finalized BufferTarget
stays in _targets until the outer Output closes, pinning its buffer.
Writer.finalize() already does this cleanup for writer-based flows;
extend it to buffer-finalize paths via the public 'finalized' event.

* fix: ReadOrchestrator LRU eviction picks only drained workers

assert(pendingSlices.length === 0) fires under heavy concurrent reads
(e.g. multi-rendition HLS decode from BlobSource). LRU filter only
checked !running; workers with queued slices could be evicted.
Add pendingSlices.length === 0 to the filter.

* fix: export AppendOnlyStreamTarget from index

Missing from the re-export; public docs import it by name.

* fix: join HLS init segment path with root + playlist path

Init path went through _getTarget bare; segments got joined with rootPath + playlist.path. Playlist-relative URI then can't resolve when the playlist lives in a subdirectory.

* Fix targets not being cleaned up, fix paused workers with remaining pending slices, modify doc block, fixed isRoot not being changed on proxied requests

---------

Co-authored-by: Vanilagy <[email protected]>
2026-04-23 14:37:56 +02:00
Vanilagy 7acae8dda1 Add a track disposition section to Writing HLS 2026-04-23 11:06:50 +02:00
Vanilagy 0524bb43eb I always forget it v1.42.0-beta.5 2026-04-22 16:57:22 +02:00
Vanilagy 4bde1c5c44 Bump to beta 5 2026-04-22 16:55:27 +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 5e8d0b25a0 Yes thank you 2026-04-21 15:14:20 +02:00
Vanilagy 3fc69490f5 Suppress range request warning for HLS-adjacent requests (closes #354) 2026-04-21 15:12:34 +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
Vanilagy d12c48562c Bump to beta 4 v1.42.0-beta.4 2026-04-18 00:21:02 +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 9a7120f5f4 Add per-playlist "mutices" for HLS muxer 2026-04-17 18:35:33 +02:00
Vanilagy 2ab6bbe3d1 Bruh 2026-04-17 15:16:08 +02:00
Vanilagy 670664c76a Add thoughts 2026-04-17 15:06:27 +02:00
Vanilagy c8c8cf214c Add first timestamp cache for performance 2026-04-17 15:06:18 +02:00
Vanilagy 7d9c063105 Small commit 2026-04-17 09:34:06 +02:00
Vanilagy 189d6851a6 Bump to beta 3 v1.42.0-beta.3 2026-04-16 18:29:45 +02:00
Vanilagy 95e9dc5210 MORE CODE REVIEW 2026-04-16 18:27:51 +02:00
Vanilagy b85ecd3109 Code review fixes 2026-04-16 17:43:12 +02:00
Vanilagy aadfa77489 Modify README 2026-04-16 16:23:59 +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 f99adf2208 Optimize media tag codec parsing, add a test for it, extract tag strings into constants 2026-04-16 11:31:43 +02:00
Vanilagy 2d0aac3208 Fix HLS demuxer parsing bug, extract HLS mime type out, add TargetRequest.mimeType 2026-04-16 10:53:36 +02:00