Commit Graph
73 Commits
Author SHA1 Message Date
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
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 f340e19baa Clarify docs 2025-09-18 10:11:27 +02:00
Vanilagy c5523516c7 Add fastStart: 'reserve' option (closes #119) 2025-09-17 12:26:24 +02:00
Vanilagy fcec67645a Allow object for tags field in conversion 2025-09-16 15:10:16 +02:00
Vanilagy d313a85053 Document cropping in more places 2025-09-12 17:30:31 +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 a295cd76c6 Oops 2025-09-08 12:54:50 +02:00
Vanilagy dcd99f8930 Add metadata tag support to Conversion API 2025-09-05 23:34:24 +02:00
Vanilagy c6cb8f7b43 Document metadata tags 2025-09-05 22:27:46 +02:00
Pablo Cúbico 904fd8f95e feat: add video crop option 2025-09-05 07:07:43 -03:00
Vanilagy 5ca5fc4633 Document onwrite in conversion docs 2025-09-02 17:48:33 +02:00
Vanilagy 9d47b3c5dc Add Target.onwrite callback 2025-09-02 17:34:09 +02:00
Vanilagy 55dd8cdb4c Add NullTarget 2025-09-02 17:20:09 +02:00
Vanilagy ef95960e13 Add support for unsized sources, add ReadableStreamSource, fix WAVE packet lookup 2025-09-02 16:39:38 +02:00
Vanilagy 35036f6621 Small fixes 2025-08-30 16:53:05 +02:00
Vanilagy f514c16ee9 Update docs 2025-08-30 16:50:52 +02:00
Vanilagy 63b8190185 Add logic for encoding video frames that change size over time (#63) 2025-08-24 16:37:03 +02:00
Vanilagy 803e58a0d2 Add internalCodecId field 2025-08-23 16:24:36 +02:00
Vanilagy bb1b20afa7 Add track name support 2025-08-23 15:33:44 +02:00
Vanilagy 134a6f8f4e Add more options to Video/AudioEncodingConfig, restructure code (#61) 2025-08-22 17:24:02 +02:00
Ally 1ce5e108a7 Implement ADTS muxer :3 2025-08-17 16:14:15 +02:00
Vanilagy 7e546c2cc7 Fix sample closing before it reaches the custom encoder 2025-08-12 15:36:17 +02:00
Vanilagy 11c15c2392 Add track-specific conversion options, fix esbuild race condition 2025-08-11 00:00:04 +02:00
Vanilagy 5608f519a7 Add xingHeader option to Mp3OutputFormat 2025-08-10 16:04:18 +02:00
Vanilagy 230f02fffc Clarify latencyMode 2025-08-10 14:36:47 +02:00
Vanilagy e1c50ef16c Clarify declaration file thing 2025-08-10 02:07:09 +02:00
Vanilagy c6227cea5a Write mp3-encoder docs 2025-08-10 02:06:09 +02:00
Vanilagy 1fe115ac83 Implement frame rate adjustment logic for Conversion API, fix source not being closed 2025-08-08 18:39:08 +02:00
Yonatan Bendahan 1aaded9241 add "duplex: 'half'" to fetch stream example 2025-08-05 15:20:12 +03:00
Vanilagy 50fe065852 Document API changes 2025-07-27 12:19:44 +02:00
Vanilagy 9bfa855f25 Downgrade @types/web-codecs for better type support, specify requirements in README and docs 2025-07-26 00:34:24 +02:00
Vanilagy d768f3c63b Add section in docs for Jonny 2025-07-25 13:22:18 +02:00
Vanilagy 5e933d9362 Add packet type derivation logic, new verifyKeyPackets options, new determinePacketType method 2025-07-24 16:09:01 +02:00
Vanilagy 4b12468008 Add support for reading and writing RF64 WAVE files 2025-07-18 16:48:23 +02:00
Vanilagy cf0bbe896a Add longer variant to VideoSample.draw 2025-07-15 11:49:33 +02:00
Vanilagy a16911874c Clarify built distribution files in docs 2025-07-09 12:14:29 +02:00
Vanilagy 326e03cfc9 Link migration guides in docs 2025-07-03 12:42:27 +02:00
Vanilagy 4e1d43a3b2 Write README 2025-06-28 19:44:20 +02:00
Vanilagy 655cab747c Add quotes, move assets around 2025-06-28 12:50:45 +02:00
Vanilagy 0ff0729fec Fix incorrect API usage in docs 2025-06-27 19:06:17 +02:00
Vanilagy bc201ca265 Home page mobile support 2025-06-26 22:00:35 +02:00
Vanilagy c546deed7a Write home page, add logo, configure theme 2025-06-23 13:18:25 +02:00
Vanilagy d5671fd8ad Add targetPacketCount parameter to computePacketStats 2025-06-18 13:19:05 +02:00