Commit Graph
16 Commits
Author SHA1 Message Date
Vanilagy 7cc26edacb Add Mediabunny Codec Registry 2026-02-12 11:56:37 +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 20e4610da4 Document MPEG-TS 2026-01-16 20:51:27 +01: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 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 0ff0729fec Fix incorrect API usage in docs 2025-06-27 19:06:17 +02:00
Vanilagy 99f813c938 Mediakit -> Mediabunny 2025-06-16 15:46:44 +02:00
Vanilagy 05881ff1f5 Add support for PCM codecs in MP4, add 64-bit float PCM support 2025-06-16 10:49:55 +02:00
Vanilagy e37af1bdad Create conversion doc page, small fixes 2025-06-08 20:40:01 +02:00
Vanilagy c7c57e2132 Add getMimeType to Output & other small adjustments 2025-06-07 22:51:57 +02:00
Vanilagy d0d847edf8 Add new utility functions for finding best codec 2025-06-05 14:01:39 +02:00
Vanilagy 65ff4d0106 Add docs for custom coders 2025-05-09 17:03:25 +02:00
Vanilagy 64294655d9 Add documentation for reading files 2025-04-28 12:14:06 +02:00
Vanilagy 5e224510be Add documentation on writing files 2025-03-31 21:21:10 +02:00
David Payr 53e8ce5cac Begin work on documentation 2025-03-29 11:47:21 +01:00