bfbd90e1d8
Account for multi-frame Opus packets when computing packet duration ( #439 )
...
* Account for multi-frame Opus packets when computing packet duration
parseOpusTocByte only read the config field of the TOC byte and always
assumed a single frame per packet. Per RFC 6716 section 3.2, a packet may
carry 1, 2 or an arbitrary number of frames, encoded in the two low bits of
the TOC byte (plus the frame count byte for code 3), and its duration is the
frame duration times the frame count.
As a result, the Ogg muxer wrote granule positions that advanced slower than
the actual audio. Chromium's MediaRecorder packs three 20 ms frames per Opus
packet, so remuxing WebM/Opus to Ogg/Opus produced files declaring a third of
their real duration: a 5.7 s recording ended with a final granule position of
99840 (2.08 s). Decoders that trust the container then truncate the audio.
* Clean up
---------
Co-authored-by: Vanilagy <[email protected] >
2026-07-18 12:05:31 +00:00
Viktor Szépe and GitHub
6812cf1643
Fix typos in source, tests, and docs ( #430 )
...
* Fix typos in source, tests, and docs
* Fix introduction guide typos
2026-07-02 09:33:43 +02:00
Vanilagy
a4884184e9
Remove GPU path for alpha merger/splitter, add worker pool for merger, allow concurrent merging for better performance
2026-06-30 18:23:59 +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
0cdf0063e2
Add VideoSample.encodeOptions, optimized ArrayBuffer-backed VideoSample cloning
2026-06-02 18:01:22 +02:00
Vanilagy
05f8ecd908
Respect Range header for UrlSource ( #387 )
2026-06-02 11:05:46 +02:00
Vanilagy
85a80972a0
Make MP3 next frame location more strict for better recovery ( fixes #382 ), fix Date timezone for ID3 tags
2026-05-22 11:31:26 +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
292189e3d4
Add toAvFrame, NodeAv* -> Av*, add server README, fix track synchronizer in conversion, increase default cache size for ReadableStreamSource
2026-05-13 15:26:13 +02:00
Vanilagy
060ceb8ed3
Fix tests some more
2026-05-12 00:43:08 +02:00
Vanilagy
5599e52a1a
Fix async race condition in transparency code, reduce HEVC conversion duration
2026-05-12 00:24:03 +02:00
Vanilagy
d8c8606341
Merge branch 'main' into server
2026-05-11 21:36:38 +02:00
Vanilagy
1bf200894c
Add CPU path for transparent encoding and decoding, add transparency support to FFmpeg-backed VP9 decoder and encoder
2026-05-11 21:33:29 +02:00
Vanilagy
a89d715524
Add VideoSample.transform(), add custom transformer functions, ditch CanvasSink path in Conversion API, add libavfilter-based VideoSample transformation
2026-05-11 15:57:51 +02:00
Vanilagy
3ae73a7c5e
Loosen constraint on format returned by toRgbSample, fix X->A conversio, fix tests
2026-05-10 17:31:56 +02:00
Vanilagy
fff69619ec
Lint
2026-05-09 00:42:37 +02:00
Vanilagy
3cde68e0ae
Fix AudioResampler emitting timestamps before startTimestamp ( fixes #366 )
2026-05-09 00:40:25 +02:00
Vanilagy
ab9958234a
Change VideoSampleResource interface, validate return values, add more proper VideoSample.copyTo() logic, fix decoder/encoder color space issues
2026-05-08 19:37:41 +02:00
Vanilagy
6d9fb30c29
Fix things that broke in the merge
2026-05-04 17:58:05 +02:00
Vanilagy
2e933ee5fc
Merge branch 'main' into sample-resources
2026-05-04 17:23:45 +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
2b3e5f45c6
Remove createInputFrom, changed meaning of PathedSource, add CustomPathedSource
2026-04-21 13:22:10 +02:00
Vanilagy
d9f12c0c7a
PLEASE BE FIXED
2026-04-14 21:49:15 +02:00
Vanilagy
a3767af141
Fix HLS muxer audio segmentation bug, fix conversion tests failing in CI
2026-04-14 21:40:07 +02:00
Vanilagy
6410ea9f42
Make Conversion API copy input pairability graph by default, fix HLS muxer rotation bug, remove onfinalized callback
2026-04-14 21:14:58 +02:00
Vanilagy
e8ba0544d1
Unexpected .only modifier
2026-04-14 16:29:19 +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
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
3c0a6fc299
Fix failing tests, add missing license headers
2026-04-01 16:39:42 +02:00
Vanilagy
b86e527dc6
Add audio resampling, remixing and processing options to AudioEncodingConfig, small AudioResampler adjustments, add more tests
2026-04-01 15:46:02 +02:00
Vanilagy
1c08589021
Add "force" transform option, formalize that transformations bake in rotation
2026-04-01 14:34:05 +02:00
Vanilagy
024660773b
Add video frame preprocessing to VideoEncodingConfig & VideoEncoderWrapper
2026-04-01 13:30:34 +02:00
Vanilagy
3bcbcc13f0
Add CMAF format and CMAF/init segment support to HLS muxer
2026-03-30 17:06:57 +02: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
1da96f6d69
Add displayAspectWidth/displayAspectHeight only when they are necessary
2026-03-19 12:25:19 +01:00
Vanilagy
e18da824ce
Make test more resilient
2026-03-04 17:12:40 +01:00
Vanilagy
bb4749cd8d
Add support for reading/writing non-square pixel video frames ( fixes #309 )
2026-02-25 17:16:33 +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
df5efa0442
Fix test
2026-02-16 15:34:42 +01:00
Vanilagy
e3aa7108f5
Make test 150% faster
2026-02-12 12:22:25 +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
7e1c93c331
Skip transparency tests for now
2026-01-23 13:50:18 +01:00
Vanilagy
277290abe3
Fix tests and elaborate on point in docs
2026-01-19 14:11:02 +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
46fbfc8a2c
Make MPEG-TS muxing tests not rely on AAC encoder
2026-01-16 21:02:12 +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
045df3b9a5
Make ADTS demuxer spit out ADTS packets instead of AAC, make ADTS muxer accept both AAC and ADTS input
2026-01-14 13:52:46 +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