Commit Graph
642 Commits
Author SHA1 Message Date
Vanilagy 216843e56a Add Aiden Liu sponsor 2025-09-19 20:20:05 +02:00
Vanilagy a3f4f7f4f7 Allow all Matroska AttachedFiles to be read & written via metadata tags 2025-09-19 20:12:29 +02:00
Vanilagy e28c34cb7a Properly merge different forms of headers in UrlSource (#126) 2025-09-19 18:04:02 +02:00
Vanilagy cfc2c2d864 Add spheric sponsor 2025-09-19 14:32:31 +02:00
Vanilagy a46e9ee9ec Fix flaky FLAC metadata reading v1.17.3 2025-09-19 14:29:41 +02:00
Vanilagy 23181a9ff6 Also run tests in release script 2025-09-19 14:07:16 +02:00
Vanilagy 88f9b64331 Fix faultily written Xing frame v1.17.2 2025-09-19 14:03:46 +02:00
Vanilagy eb1ce86187 Fix faulty MP3 bitrate and frame size calculation (fixes #134) v1.17.1 2025-09-19 13:20:36 +02:00
Vanilagy e88bc15b0e Bump minor v1.17.0 2025-09-18 23:43:11 +02:00
420423bc0f feat: Add support for custom MP4 metadata with mdta format (#132)
* feat: Add support for custom MP4 metadata with mdta format

- Add metadataFormat option ('mdir' | 'mdta') to IsobmffOutputFormatOptions
- Implement complete mdta format with keys box generation
- Enable custom metadata fields readable by ffmpeg/ffprobe
- Maintain backward compatibility with default mdir format

* Refactor ISOBMFF metadata tag writing logic

* Autism

---------

Co-authored-by: tanfu <[email protected]>
Co-authored-by: Vanilagy <[email protected]>
2025-09-18 23:41:08 +02:00
d426d36386 FLAC container support (#95)
* add a test

* recognize as input format

* scaffold flac demuxer

* implement getting metadata

* Implement mime type

* read all metadata + deduplicate stubs

* Read first packet

* copyright headers

* read the first packet

* Get entire first packet, work on advancing

* iterate over all samples

* testable with bun

* stub out metadata support

* parse descriptive metadata

* All in 1 file

seems more appropriate to the philosophy

* some parameters are not needed anymore all within 1 class

* skip over bytes we are sure are not the syncword

* run prettier

* timestamp is determined based on passed blocks, not maximumBlockSize

* no binary search needed!

* simplifications

* Finish demuxer reading sequentially

* more tests + add a file with a seektable

* don't throw if (this.audioInfo.minimumBlockSize !== this.audioInfo.maximumBlockSize

* Add docs

* Update format compatibility table

* Simplification

* confirm conversion is working

* Finish

* Resolve TODO comment

* Support images (read-only)

* Returning description as Uint8Array

* Cleanup of demuxer

* Misc renames

* Object on same line

* Resolve first batch of comments

* Throw errors on corrupt blocks, correctly use requestSlice()

* Fix description field

* Explain why last frame is a bit shorter

* Add FLAC to README

* Put track backings below demuxer

* convert to methods

* Reorder container checking

* getBlockSize() -> readBlockSize()

* bitStream -> bitstream

* better naming for bytes

* use .skip()

* Don't return blockSize twice in readFlacFrameHeader

* Use enum + switch to distinguish Flac block types

* Use else-if

* Use else-if

* Compressed switch statement

* readCodedNumber

* Update flac-misc.ts

* We don't need the bits variable at all

* reorder functions in flac-demuxer

* Handle gracefully not being able to load another sample

* Update flac-demuxer.ts

* blockingbit null

* use async instead of promise.resolve

* use binary search

* Replace recursion with while loop

* Add mutex to getPacket()

* Load more data not in getPacketAtIndex, but outside

* Apply suggestion from @Vanilagy

Co-authored-by: David P. <[email protected]>

* computeDuration() reads last packet

* Update flac-demuxer.ts

* share vorbis comment reading logic

* reuse vorbis comment writing logic, set vendor always to "Mediabunny"

* flush after writign

* Use FileSlice.tempFromBytes

* assert !== null

* fixing nitpicks

* apply suggestions

* fix ogg

* We are now muxing images

* apply suggestion

* Update src/flac/flac-muxer.ts

Co-authored-by: David P. <[email protected]>

* apply suggestion

* readSampleRate()

* seek outside writeHeader()

* mention vorbis metadata +  add to metadatatags comment

* should be able to -> can

* Add test in metadata tags

* Add test for packets being byte identical after remuxing

* compare to null

* no casting to uint8array

* make test pass

* Update flac-muxer.ts

* Call validateAudioChunkMetadata() and validateAndNormalizeTimestamp()

* `onFrame` option

* emit frames using onFrame

* Run prettier over files

* Fix FLAC PICTURE block logic, small other changes

* Update docs

* Remove .only modifier

* fix remuxing and add test

* Don't throw error if parsing fails in header, since hitting a syncword might just be coincidential

* Fix remaining type errors

---------

Co-authored-by: David P. <[email protected]>
2025-09-18 21:05:09 +02:00
Vanilagy 7664d48f70 Merge branch 'main' of https://github.com/Vanilagy/mediabunny 2025-09-18 15:14:01 +02:00
Vanilagy 4fd90cf73b Add missing block scope condition 2025-09-18 15:14:01 +02:00
David P.andGitHub d0c0a9221f Merge pull request #128 from JonnyBurger/headless-mode
Enable headless mode for browser tests
2025-09-18 11:10:12 +02:00
Jonny Burger 4c313ad2a6 Enable headless mode for browser tests 2025-09-18 10:55:42 +02:00
Vanilagy f340e19baa Clarify docs 2025-09-18 10:11:27 +02:00
Vanilagy 407dd05953 Make Matroska block decoding lazy v1.16.1 2025-09-18 10:00:03 +02:00
Vanilagy f13a81bee3 Bump minor v1.16.0 2025-09-17 23:09:53 +02:00
Vanilagy 6d5bd58ae8 Add support for header removal content compression in Matroska 2025-09-17 23:09:04 +02:00
Vanilagy 6907e25c6d Fix invalid Vorbis description for Ogg demuxer 2025-09-17 18:06:41 +02:00
Vanilagy 1a1664683b run -> GOP 2025-09-17 16:39:35 +02:00
Vanilagy 13224d2998 Add HADB sponsor 2025-09-17 14:15:45 +02:00
Vanilagy c5523516c7 Add fastStart: 'reserve' option (closes #119) 2025-09-17 12:26:24 +02:00
David P.andGitHub ec910bdd2c Merge pull request #124 from studnitz/main
Pin github actions to commit SHAs
2025-09-17 12:00:26 +02:00
Alexander von Studnitz 32b3007a3f Pin github actions to commit SHAs
This reduces the attack surface of supply-chain attacks and is generally a good practice.
2025-09-17 11:55:41 +02:00
Vanilagy f13941d350 Add Mux sponsor 2025-09-17 09:11:56 +02:00
Vanilagy 7d725d068b Bump patch v1.15.2 2025-09-16 23:12:51 +02:00
Vanilagy 7a0051bec5 Tag spam 2025-09-16 21:27:54 +02:00
Vanilagy 555006b9c3 Add improved logic for loading Node.js module (fixes #118) 2025-09-16 21:13:32 +02:00
Vanilagy 1bb3c0e262 Avoid opaque canvases in case of Firefox (fixes #117) 2025-09-16 17:42:23 +02:00
Vanilagy 530ccd7523 Drag 0-duration VideoFrame duration to null (fixes #116) 2025-09-16 15:50:14 +02:00
Vanilagy fcec67645a Allow object for tags field in conversion 2025-09-16 15:10:16 +02:00
Vanilagy 7efb092ff5 Add parsing of 'track' metadata key for ISOBMFF 2025-09-16 14:46:27 +02:00
Vanilagy d313a85053 Document cropping in more places 2025-09-12 17:30:31 +02:00
Vanilagy 1534eb4c40 Lint 2025-09-12 17:26:52 +02:00
Vanilagy 8fb08f1c8e Fix missing @group tag, add doc generation validation to build script v1.15.1 2025-09-12 17:16:12 +02:00
Vanilagy bc90a6dc16 Bump minor v1.15.0 2025-09-12 16:58:46 +02:00
David P.andGitHub ea8027bacb Merge pull request #97 from pablocubico/crop-feature
Add Crop feature
2025-09-12 16:56:56 +02:00
Vanilagy 3cfb9f27cb Prefix crop validation error messages 2025-09-12 16:52:55 +02:00
Vanilagy 684b7b7391 Fix order 2025-09-12 16:50:14 +02:00
Vanilagy c9433771e9 Fix description in docs 2025-09-12 16:49:46 +02:00
Vanilagy eba1f360d5 Clean up cropping logic 2025-09-12 16:48:35 +02:00
Vanilagy 4aca172d14 Merge branch 'main' into fork-branch 2025-09-12 15:46:12 +02:00
Vanilagy 6f06631355 Use decoder information for resampler sample rate, fix Opus sample rate to 48 kHz everywhere v1.14.4 2025-09-10 23:03:20 +02:00
Vanilagy f314f04037 Add wcw 2025-09-10 16:52:45 +02:00
Vanilagy b9f7ab2fa2 Skip HEVC RASL slices following a decoder reset v1.14.3 2025-09-09 13:09:41 +02:00
Vanilagy a295cd76c6 Oops 2025-09-08 12:54:50 +02:00
github-actions[bot] b9efcc867d Merge main into release for tag v1.14.2 2025-09-07 20:37:38 +00:00
Vanilagy cb9f4e0fdf Fix conversion progress non-monotonicity v1.14.2 2025-09-07 22:36:53 +02:00
github-actions[bot] d63d7f6ff9 Merge main into release for tag v1.14.1 2025-09-06 10:01:23 +00:00