Commit Graph
194 Commits
Author SHA1 Message Date
Vanilagy 8fea9671ea Fix some demuxer bugs that occurred on files by FFmpeg, fix packet marking logic 2026-01-15 08:51:07 +01:00
Vanilagy 0719a17c85 Add mutex to packet lookup algorithm, fix incorrect next packet retrieval following packet lookup 2026-01-14 21:53:23 +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 06ab9c8433 Add support for different TS packet strides and offsets, add proper input format detection, fix error messages, add packet lookup algorithm with no file size known 2026-01-14 13:16:40 +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
David P.andGitHub 8aac07eb61 Merge pull request #279 from samohovets/bugfix/vorbis-eos
Fix OGG Vorbis decoding error for files with empty EOS pages
2026-01-13 17:36:09 +01:00
Vanilagy 267c09abf8 Return null earlier on 2026-01-13 17:34:33 +01:00
Igor Samokhovets a89101ff40 Fix OGG Vorbis decoding error for files with empty EOS pages (VLC-encoded) 2026-01-13 13:45:43 +01:00
Vanilagy 2ab1be3834 Add maximumPageDuration Ogg muxer option (closes #277) 2026-01-13 13:37:34 +01:00
Vanilagy 78e78e5b4f Make _flushOrWaitForOngoingClose set closingPromise (fixes #270) 2026-01-12 14:36:51 +01:00
Vanilagy 8f43086e3d Make allocationSize and copyTo always throw if internal format is null (closes #267) 2026-01-05 11:07:32 +01:00
Vanilagy 700a95ac35 Merge branch 'main' into sample-resources 2025-12-30 17:22:40 +01:00
Vanilagy c86af052f5 Add test for Annex B to length-prefixed conversion 2025-12-19 16:04:27 +01:00
Vanilagy a56f9bd961 Rename 2025-12-17 15:41:52 +01:00
Vanilagy 12b8a1ac5a Merge branch 'main' into sample-resources 2025-12-17 15:41:36 +01:00
Vanilagy 15bdd072e1 Add options to VideoSample allocationSize and copyTo methods, add explicit error message when format is null (closes #256) 2025-12-17 15:10:25 +01:00
Vanilagy 81d3d1e6a4 Add VideoSampleResource and AudioSampleResource 2025-12-17 11:14:12 +01:00
Vanilagy 228721d68f Add VideoSampleColorSpace 2025-12-16 18:47:50 +01:00
Vanilagy 18d64ffb33 Change ProRes codec string, remove ProRes RAW variants for now 2025-12-10 10:18:53 +01:00
Vanilagy 0dd53ff1f7 Add ProRes codec and allow demuxing & muxing 2025-12-10 09:52:54 +01:00
Vanilagy 3dd7a9cb58 Fix unclosed samples in tests 2025-12-04 17:04:24 +01:00
Vanilagy abe6185ddd Fix test? 2025-11-13 11:02:36 +01:00
Vanilagy 217b383f12 Add read/write support for track disposition information 2025-11-13 11:00:42 +01:00
JonnyBurger fe4eebd487 Increase tolerance of pixels by 1 in tests 2025-11-05 10:54:03 +01:00
Vanilagy efcf5d0069 Add vjeux 2025-11-02 22:03:35 +01:00
Vanilagy aad31009fe Make test more strict 2025-11-02 21:56:16 +01:00
Vanilagy 68c37b49dc Another test test 2025-11-02 21:50:49 +01:00
Vanilagy b12fee70a3 Log test 2025-11-02 21:47:49 +01:00
Vanilagy 90d5aed051 Test test 2025-11-02 21:46:24 +01: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 2025-09-26 10:06:13 +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 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 608c769a7e Add explicit disposability to Inputs (#126) 2025-09-21 20:18:59 +02:00
Vanilagy a3f4f7f4f7 Allow all Matroska AttachedFiles to be read & written via metadata tags 2025-09-19 20:12:29 +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
Jonny Burger 4c313ad2a6 Enable headless mode for browser tests 2025-09-18 10:55:42 +02:00
Vanilagy dcd99f8930 Add metadata tag support to Conversion API 2025-09-05 23:34:24 +02:00
Vanilagy bd99d8f28f Add metadata tests, fix a few bugs 2025-09-05 21:42:26 +02:00
Jonny BurgerandGitHub f13a2e6732 Merge pull request #86 from JonnyBurger/url-source-allow-reading-small-files
Do not make UrlSource fail if the size of the file is smaller than 512kb (+ add a Vitest browser mode test)
2025-09-03 18:13:42 +02:00
Vanilagy e5df6f1a63 Add FilePathSource for server-side use 2025-08-30 16:32:14 +02:00
Jonny BurgerandGitHub 0e6cddc941 Add a test (#77)
* Match Prettier style

This way, people who have Prettier as their default formatter in their Editor (probably the majority of people) will not have the code re-formatted to double quotes if they are saving

* Add trailing-comma option

* Instruct .vscode to use ESLint as a default formatter

* Discard changes to package.json

* Add a first test

* Setup CI

* Rename to test

* move tsconfig hacks to local tsconfig.json

* Better test title

* rename file

* Fix ts setup
2025-08-27 09:12:49 +02:00