Commit Graph
209 Commits
Author SHA1 Message Date
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
Vanilagy de84d78092 Merge branch 'main' into hls 2026-02-16 15:55:59 +01:00
Vanilagy ddc826e6e3 MPEG-TS muxer: Write out DTS for video tracks (fixes buggy QuickTime behavior) 2026-02-16 15:30:23 +01:00
Vanilagy a97200f3f0 Add @mediabunny/ac3 extension package 2026-02-12 18:31:59 +01:00
Vanilagy 4fae45ec40 Allow negative trim ranges for conversion, add OutputFormat.supportsTimestampedMediaData 2026-02-11 15:56:51 +01:00
Vanilagy d1fbea3e19 [WIP] Add majority of logic for HLS reading support 2026-01-27 14:45:44 +01:00
Vanilagy 6c78a0ff09 Fix HEVC not being encodable in CI 2026-01-19 10:25:57 +01:00
Vanilagy c3a3eb6abf Merge remote-tracking branch 'origin/main' into mpeg-ts 2026-01-16 21:04:14 +01:00
Vanilagy 282751ec1c Set discontinuity_indicator to 1 for the first packet 2026-01-16 16:56:50 +01:00
Vanilagy e8b27768a9 Add MPEG-TS muxer, fix a demuxer bug, remove Infinity from output format track counts 2026-01-16 16:33:28 +01:00
Vanilagy ae37973878 MPEG-TS demuxer optimizations: faster Annex B segmentation, better NALU iteration 2026-01-16 13:26:58 +01:00
Vanilagy c0f2693cb3 Add HEVC support to MPEG-TS demuxer 2026-01-16 10:05:40 +01:00
Vanilagy 54dfa75a7e Add proper packet duration extraction to MPEG-TS demuxer 2026-01-15 16:33:17 +01:00
Vanilagy 0719a17c85 Add mutex to packet lookup algorithm, fix incorrect next packet retrieval following packet lookup 2026-01-14 21:53:23 +01:00
Vanilagy 24af125415 Make Conversion.cancel() cause execute() to throw (closes #271) 2026-01-12 15:13:00 +01:00
Vanilagy f363fe50e2 WIP 2026-01-05 11:41:32 +01:00
Vanilagy 84dec01dfd Add pause and resume methods to MediaStreamTrack sources (closes #241) 2025-12-11 15:51:18 +01:00
Vanilagy cc649ba192 Add allowRotationMetadata video conversion option (see #247) 2025-12-11 14:41:00 +01:00
Vanilagy d6c223b0f6 Fix keyframe sample index lookup logic for ISOBMFF in rare B-frame scenarios 2025-12-05 22:14:23 +01:00
Vanilagy 5b703a1c78 Fix MP3 encoder emitting incorrect timestamps, fixed overaggressive audio sample gap filling (fixes #233) 2025-12-05 12:41:36 +01:00
Vanilagy 3620b04caf Fix incomplete AV1 sequence header OBU parsing, fix missing saample close() calls in audio resampling path, add error logging when open samples are GC'd, bump patch 2025-12-04 09:58:12 +01:00
Vanilagy 217b383f12 Add read/write support for track disposition information 2025-11-13 11:00:42 +01:00
Vanilagy 02b08e036b Fix Matroska files where no audio packets are key packets (fixes #192) 2025-11-12 16:07:17 +01:00
Vanilagy 12216ae29e Remove reordering Matroska blocks by references (fixes #178) 2025-11-12 10:49:47 +01:00
Vanilagy e33e9f13fe Fix missing VideoSample.close() calls in CanvasSink conversion path 2025-11-12 10:05:41 +01:00
Vanilagy 23f814679e Modify audio encoder to fill gaps between timestamps with silence to ensure AV sync (fixes #176) 2025-11-11 18:03:28 +01:00
Vanilagy 71dd2c565b Merge branch 'main' of https://github.com/Vanilagy/metamuxer 2025-11-11 11:05:17 +01:00
Vanilagy 3db4aa8b91 Fixed doubly stacked rotation correction when converting rotated video with a custom process function (fixes #218) 2025-11-11 11:05:15 +01:00
Vanilagy 8b39eb0d43 Revert Matroska default duration flooring 2025-11-10 21:14:43 +01:00