Commit Graph
237 Commits
Author SHA1 Message Date
Vanilagy f767b6f601 Fix AVC software decoder sometimes dropping B-frames (fixes #488) 2026-09-09 16:55:06 +02:00
Vanilagy b560977b50 Fix empty audio trim range crashing conversion (fixes #486) 2026-09-08 16:19:56 +02:00
Vanilagy a1ba54d337 Implement more powerful copy conversions, add conversion copy config, add OutputFormat.negativeTimestampSupport, fix Matroska duration from metadata computation 2026-09-08 14:42:03 +02:00
Vanilagy 9726b0cb4e Add negative timestamp muxing support to Matroska 2026-09-04 12:17:33 +02:00
Vanilagy 3c94d062d2 Allow negative timestamps in media sources, add negative timestamp support to ISOBMFF muxer 2026-09-04 11:48:50 +02:00
Vanilagy 7d1eb5b063 Fall back to color space information from bitstream, fill missing color space fields when passing it to Chromium's VideoDecoder, fix AV1 Sequence Header OBU parsing, fix vpcC box generation, still mux partial color space info into container (fixes #474, closes #475) 2026-08-29 19:48:20 +02:00
Vanilagy d44253c7d3 Fix incomplete parsing and generation of AacAudioSpecificConfig (fixes #471) 2026-08-26 13:40:14 +02:00
Vanilagy 3c4f4c27a3 Slightly restructure code 2026-08-21 20:06:28 +02:00
Vanilagy dc068a0aa8 Add computeFrameRateMetrics and heuristics to determine a video's true frame rate 2026-08-12 16:10:28 +02:00
Vanilagy b0a8802918 Fixed missing mipmapping in the VideoSample transform case, now guaranteed via a manual mipmap algo 2026-08-06 16:31:46 +02:00
Vanilagy 445911edd0 Fix ISOBMFF muxer track alternate groups (fixes #454), fixed mutex race condition in Output 2026-08-03 14:50:36 +02:00
Vanilagy d5362e20ad Fix incorrect video depth being written in ISOBMFF for video tracks with an alpha channel (fixes #450) 2026-07-30 17:45:33 +02:00
c3df2a24e5 Add custom quality factors and quantizer bitrate mode (#448)
* Add custom quality factors and quantizer bitrate mode (closes #327)

* Fix quantizer mode fallback and per-frame quantizer edge cases

* Clean up quantizer mode tests

* Quantizer implementation

* Add quality tests

* Improve conversion codec error message, make test more lenient

* Add quantizer support blog post

---------

Co-authored-by: Vanilagy <[email protected]>
2026-07-30 17:24:59 +02:00
Vanilagy bfd4059c22 Add advanced access unit delimination logic to MPEG-TS demuxer (fixes #414), ignore irrelevant PIDs in MPEG-TS metadata reading 2026-06-17 17:16:39 +02:00
Vanilagy 8b9a1acf16 Fix Conversion API process callbacks being called *before* other transformations (fixes #403), restructure Conversion API to make full use of in-source transformations, add AudioSample.trim() 2026-06-15 18:30:16 +02:00
Vanilagy a0574fa09a Fix decoded audio always starting at 0, fix startTimestamp=0 for ranged media iterators (fixes #370) 2026-05-13 18:54:45 +02:00
Vanilagy 3cde68e0ae Fix AudioResampler emitting timestamps before startTimestamp (fixes #366) 2026-05-09 00:40:25 +02:00
Vanilagy 9ed21bf9c6 Fix behavior with files with invalid pasp box (with num & den === 0) (fixes #362) 2026-05-02 14:27:25 +02:00
Vanilagy 782d3e134b Use edit lists to model non-zero start timestamps for regular MP4 (fixes #336); fix MP4 PCM logic breaking down with approximate packet timestamps 2026-04-30 10:32:42 +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 2d49122277 Sanitize initial HEVC packet to avoid Chromium's validation logic from tripping up (#314) 2026-04-29 11:37:56 +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 9a1b8b2602 Add timestampBase option for live MediaStreamTrack sources 2026-04-27 19:38:45 +02:00
Vanilagy 15beb69137 Update convert.html 2026-04-27 17:58:55 +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 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 2b3e5f45c6 Remove createInputFrom, changed meaning of PathedSource, add CustomPathedSource 2026-04-21 13:22:10 +02:00
Vanilagy 2f576aa486 Add fan-out API to Conversion API, fix erroneous track count validation 2026-04-14 16:27:02 +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 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 7d053ae50d Add ConversionOptions.tracks, add better converstion start timestamp computation, optimize endPacket logic, utilize metadata duration for progress callback for better performance 2026-04-08 17:07:02 +02:00
Vanilagy 5bc1a31b8e Rewrite HLS segmentation algo AGAIN, add a bunch of HLS segmentation tests, add VideoEncoder/AudioEncoder timing refinement logic, fix HLS output spec violations 2026-03-26 16:23:07 +01:00
Vanilagy 3e87d747e6 Add HLS master playlist generation, add multi-playlistadd output track grouping, add multi-playlist HLS files, add configurable playlist and segment names, add TrackDisposition.primary 2026-03-24 15:53:21 +01:00
Vanilagy 587e98391e Merge branch 'main' into hls 2026-03-19 16:52:00 +01:00
Vanilagy 0d50526ff6 Fix incorrectly-written video rotation metadata even when rotation is baked into the video (fixes #329) 2026-03-19 14:25:40 +01:00
Vanilagy e42fc85f19 Merge branch 'main' into hls 2026-03-13 17:07:31 +01:00
Vanilagy a9a455e132 Add metadata-based duration retrieval 2026-03-13 17:03:36 +01:00
Vanilagy 35e16ca23e Fix incorrect GOP timestamp verification logic for first GOP (fixes #321) 2026-03-13 10:45:34 +01:00
Vanilagy c43ca025d9 Add proper reference count-based source disposal system 2026-03-12 21:29:01 +01:00
Vanilagy e8df451bf5 Add support for live HLS streams, add playlist refresh logic, add live input tracks 2026-03-12 15:54:19 +01:00
Vanilagy 2087658eea Add <video> element fallback case for MediaStreamVideoTrackSource, adding Firefox support 2026-03-06 16:11:59 +01:00
Vanilagy c088a31384 Various fixes 2026-03-06 15:49:24 +01:00
Vanilagy 22716b1f83 Merge branch 'main' into hls 2026-03-06 10:59:24 +01:00
6a11a1302c Fix CTS=0 in fragmented fMP4 with multiple tracks (#317)
* Fix CTS=0 in fragmented fMP4 with multiple tracks

When muxing fragmented MP4 with both video and audio tracks,
compositionTimeOffset (CTS) was zero for all video samples, causing
B-frame content to display in decode order instead of presentation
order (visible judder).

Root cause: During finalize(), interleaveSamples(true) triggers
finalizeFragment() via the cross-track keyframe check in
addSampleToTrack. This writes the trun box before processTimestamps
has computed correct decodeTimestamp values, so CTS = PTS - DTS = 0.

Fix: Call processTimestamps() for all tracks at the start of
finalizeFragment(). This is safe because processTimestamps is a no-op
when the timestampProcessingQueue is empty.

Video-only fragmented muxing was unaffected because the single-track
case never triggers the cross-track keyframe check during
interleaveSamples.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Fix the problem at the actual root

* Oopsie doopsie

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Vanilagy <[email protected]>
2026-03-06 09:56:53 +00:00
Vanilagy f79834c3c1 Add frame rate-based sampling for MediaStreamVideoTrackSource, reducing the probability of files with wildly irregular FPS; add unthrottled timer primitives 2026-03-05 19:57:32 +01:00
Vanilagy dc4e557776 Read #EXT-X-PROGRAM-DATE-TIME, add Unix epoch-offset timestamps, parallelize HLS master playlist resolution 2026-03-04 11:08:42 +01:00
Vanilagy cfb5418fa0 Refactor HLS API: Get rid of specialized Manifest* classes, use Input instead. Add unhydrated InputTracks, InputTrack compatibility, InputTrack queries 2026-03-03 15:28:26 +01:00
Vanilagy b0604150c1 Merge branch 'main' into hls 2026-02-26 15:53:46 +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 68b3ae7155 A BUNCH of HLS (and related) progress
- Add support for fMP4 segments
- Add initInput (supported by ISOBMFF and MPEG-TS)
- Input.isSupported()
- Refactored file size retrieval logic, the file size can now be retrieved alongside the first read.
- Add support for unsized UrlSources
- Add support for multiple trun boxes in a row for the same track (as the spec literally says lol)
- Add support for more M3U8 features
- Fix faulty line reader
- MPEG-TS improvements: support video parameters not in first packet, support better key frame detection, support extension PES packets without PTS
- Fix reorder buffer being 1 element too small
2026-02-20 19:56:20 +01:00