Commit Graph
576 Commits
Author SHA1 Message Date
JonnyBurger d58b638277 Stop retrying UrlSource if CORS error is suspected 2025-09-30 14:11:17 +02:00
Vanilagy 8636297ee0 PQINA -> Pintura Labs 2025-09-30 13:37:02 +02:00
Vanilagy 045fe7652a Bump patch v1.21.1 2025-09-29 20:59:59 +02:00
Vanilagy b74854d0a0 Add .js extension even in declaration files 2025-09-29 20:43:40 +02:00
Vanilagy 7d747ae6d9 Dedent 2025-09-29 20:37:10 +02:00
Vanilagy 198928088b Make cluster/fragment lookup operations almost stateless, fix high Matroska memory, allow more maxCacheSizes 2025-09-29 20:36:37 +02:00
Vanilagy 0185383794 Add PQINA sponsor 2025-09-29 09:58:03 +02:00
Vanilagy 93a750316a Bump minor version v1.21.0 2025-09-26 16:34:00 +02:00
Vanilagy a1008b8088 Fix invalid crop region for rotated video samples (fixes #151) 2025-09-26 16:31:24 +02:00
Vanilagy be151d3494 Add isValid field to Conversion if output track counts haven't been reached, improve error messages to be more clear (closes #148) 2025-09-26 13:11:35 +02:00
Vanilagy 1b8e4f9f4b Add alpha option to Conversion API 2025-09-26 11:12:48 +02:00
Vanilagy d708df9a2c Add mdta MP4 metadata tests 2025-09-26 10:14:52 +02:00
Vanilagy e7c7a82fe3 Fix test v1.20.1 2025-09-26 10:06:13 +02:00
Vanilagy 4819bf6755 Fix udta string box being read when the field was non-string, fix out of bounds string read (fixes #150) 2025-09-26 10:01:20 +02:00
Vanilagy f71ba8bc9e Fix oopsie 2025-09-26 09:38:09 +02:00
Vanilagy 291e7a7122 Fix test runner in release script v1.20.0 2025-09-25 15:20:48 +02:00
Vanilagy 728c8cd928 Bump minor version 2025-09-25 15:11:48 +02:00
Vanilagy 3f03eb8fbb Small adjustments 2025-09-25 14:49:09 +02:00
Vanilagy 537119357d Add strict slice range validation, fix RF64 reading error (fixes #146) 2025-09-25 10:26:44 +02:00
Vanilagy a043f410fd Make samples disposable 2025-09-24 21:41:52 +02:00
David P.andGitHub fa4e064345 Transparent video read/write support (#145)
* Add support for reading transparent Matroska and implement alpha side data & decode

* Few fixes

* Implement alpha encoding

* Gracefully handle inability to acquire WebGL context, properly clean up WebGL contexts

* Improve touch device detection

* Test test

* Test test #2

* Test test 3

* Test test 4

* Test test 5

* Test test 6

* Test test 7

* Test test 8

* Test test 9

* Test test 10

* Test test 11

* Test test 12

* Test test 13

* Test test 14

* Test test 15

* Test test 16

* Test test 17

* Test test 18

* Test test 19

* Test test 20

* Fix type errors, improve MetadataTags docs

* Do a bunch of docs work

* Test test?

* "Unexpected only modifier 🤓"

* Add InputVideoTrack.canBeTransparent()

* Some clean-up

* Adjust CI to be less spammy in PRs

* Fix broken license headers
2025-09-24 21:20:14 +02:00
Vanilagy 0878dd2ca9 Make stripped Node.js import more resilient v1.19.1 2025-09-24 11:41:48 +02:00
Vanilagy 1b1dd24959 Add missing docs 2025-09-22 22:06:09 +02:00
Vanilagy fb0bc07bb5 Bump minor v1.19.0 2025-09-22 21:54:41 +02:00
Vanilagy f9a7735aae Explicitly throw for odd video dimensions for AVC and HEVC (closes #142) 2025-09-22 15:37:31 +02:00
6aee4e6a6a Fix WAV files with embedded ID3 metadata returning empty tags (#110)
* Read ID3v2 tags from WAV file

* remove js import

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

* revert slicing in wave-demuxer.ts and add id3.ts for further sharing

* Add `writeId3Tag` to the `WavOutputFormat` constructor options

* add more context in private and public APIs that it's non-standard

* compare actual values in the test with real file

* remove unnecesarry double slice requesting

* trim test audio file (i tried my best to preserve ID3, including artwork)

* Couple of code cleanups

* const -> using

* Fix linting errors

---------

Co-authored-by: David P. <[email protected]>
2025-09-22 14:06:06 +02:00
Vanilagy cab8319051 Add metadata tags example to README 2025-09-22 11:16:49 +02:00
Vanilagy 15db099caf Add fetchFn to UrlSourceOptions, allow Request as UrlSource input, pass error message to getRetryDelay, add fallback for Blob.stream() 2025-09-22 11:10:39 +02:00
Vanilagy 63145c9ced Improve docs 2025-09-21 23:41:10 +02:00
Vanilagy 608c769a7e Add explicit disposability to Inputs (#126) 2025-09-21 20:18:59 +02:00
Vanilagy 34c01fbb10 Add node:fs/promises to browser field in package.json (fixes #139) v1.18.1 2025-09-21 18:50:47 +02:00
Vanilagy de28817895 Bump minor v1.18.0 2025-09-21 17:45:28 +02:00
Vanilagy d855038fd4 Fix incorrect MP3 frame size calculation (fixes #140) 2025-09-21 17:42:31 +02:00
Vanilagy 9e1a23aefd Generate random BigInts instead of doubles 2025-09-19 23:21:36 +02:00
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