Commit Graph
28 Commits
Author SHA1 Message Date
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 783cfa6fbe Add AppendOnlyStreamSource, adjust examples to use it 2026-04-21 14:58:33 +02:00
Vanilagy aa810fc433 Fix SourceRef race conditions, fix "source" and "target" getter returning unused instances, add missing validation, make "getDurationFromMetadata" only exist on tracks, fix examples, expand media player to support live playback, change the signatures of some Input APIs 2026-04-10 13:38:14 +02:00
Vanilagy 340b5eede7 Add support for writing Unix epoch-relative tracks to HLS, add proper cleanup of all Targets obtained by an Output 2026-03-31 15:12:38 +02:00
Vanilagy e2e8aaab78 Refactor Target and Writer, add single-file HLS writing mode 2026-03-27 18:07:26 +01:00
Vanilagy dd8621b6d5 Start work on HlsOutputFormat 2026-03-17 15:25:06 +01:00
31147d6e96 fix: surface StreamTarget write errors instead of swallowing them (#305)
* fix: await StreamTarget writes to prevent overlapping OPFS operations

* no need for flush

* preserve fire and forget writes

* Remove pendingWrites, add missing mutex acquire to ADTS muxer finalize method

---------

Co-authored-by: Vanilagy <[email protected]>
2026-02-24 11:21:13 +00:00
Vanilagy 7e8f9fbbb1 It's 2026 2026-01-16 17:02:12 +01:00
Vanilagy 75096edb23 Update TypeScript, fix generic ArrayBufferView type errors, allow SharedArrayBuffer as input for BufferSource 2025-11-26 12:04:23 +01:00
Vanilagy 9464adf22f Remove pure annotations for non-function call expressions (fixes #225) 2025-11-18 11:36:20 +01:00
Vanilagy 3cb6ed82ce Fix globals not being treeshakable by some bundlers (fixes #172) 2025-11-12 13:11:18 +01:00
Vanilagy 9d47b3c5dc Add Target.onwrite callback 2025-09-02 17:34:09 +02:00
Vanilagy 55dd8cdb4c Add NullTarget 2025-09-02 17:20:09 +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 a64ebab435 Small monotonicity adjustments 2025-03-29 12:01:03 +01:00
Vanilagy 95cc8beb06 Fix chunked writing issues & drop ChunkedStreamTargetWriter 2025-03-26 21:35:19 +01:00
Vanilagy ceb2528014 Add specific, per-output-format data callbacks & rewrite some logic in the process 2025-03-22 20:30:24 +01:00
Vanilagy 2625dc7662 Implement PCM encoders 2025-01-05 15:58:20 +01:00
Vanilagy 37820f1d4c Replace ArrayBufferTarget with BufferTarget, now spitting out Uint8Array and using .resize 2025-01-05 14:24:06 +01:00
Vanilagy 141bed1b37 Add Output.cancel 2025-01-02 19:57:32 +01:00
Vanilagy ecfd193ae0 Start work on demuxing 2024-12-08 15:19:56 +01:00
Vanilagy 6730e41c07 Add ESLint and lint a bunch 2024-12-01 17:33:54 +01:00
Vanilagy 266fcd473e Use WritableStream for StreamTarget & integrate backpressure concepts 2024-11-28 22:06:49 +01:00
Vanilagy 527108f44e Replace # with private 2024-11-26 20:47:58 +01:00
Vanilagy b51b2b1b45 Address a bunch of TODOs and add parameter validation everywhere 2024-11-24 21:17:00 +01:00
Vanilagy 29ecccb26a Add WebVTT subtitle support to MP4 & a bunch of misc changes 2024-11-24 14:57:31 +01:00
Vanilagy dd6526a070 Start implementation 2024-11-09 21:50:31 +01:00