Compare commits

..
140 Commits
Author SHA1 Message Date
Vanilagy 1a4fec9f6e Bump TurboRes & patch 2026-07-01 17:18:21 +02:00
Vanilagy 8c8ce8a4a5 Merge main into release AFTER the npm publish completes 2026-07-01 16:26:58 +02:00
Vanilagy 7ea8f6d751 Up timeout on test 2026-07-01 16:25:53 +02:00
Vanilagy 8fb22633fe Add frame container atom header stripping & readding for ProRes in Matroska, bump patch 2026-07-01 16:22:38 +02:00
Vanilagy 0480ecbd3a Bump TurboRes version, mention response headers in README, bump patch 2026-07-01 15:27:36 +02:00
Vanilagy 9547d36353 Add workaround for https://issues.chromium.org/issues/529852980 2026-07-01 13:50:48 +02:00
Vanilagy d8d22aa4eb Make release workflow build the docs 2026-07-01 11:40:03 +02:00
Vanilagy 50b281a9f8 Merge branch 'main' into release 2026-07-01 11:37:12 +02:00
Vanilagy 409961c02b Rename 2026-07-01 11:35:22 +02:00
Vanilagy d8a6e09a85 Up timeout 2026-07-01 11:32:45 +02:00
Vanilagy 2c7e8d85ca Create separate Build check CI 2026-07-01 11:28:52 +02:00
Vanilagy a9441aa9a9 Fix API docs generation issue 2026-07-01 11:25:24 +02:00
github-actions[bot] 403093c514 Merge main into release for tag v1.50.0 2026-06-30 20:08:10 +00:00
github-actions[bot] 54e74bfa4b Merge main into release for tag v1.49.0 2026-06-18 17:48:19 +00:00
github-actions[bot] df76bae503 Merge main into release for tag v1.48.1 2026-06-17 18:27:21 +00:00
github-actions[bot] b617c5f720 Merge main into release for tag v1.48.0 2026-06-16 18:41:51 +00:00
github-actions[bot] a5df6c7b89 Merge main into release for tag v1.47.0 2026-06-16 07:58:35 +00:00
github-actions[bot] 210d382113 Merge main into release for tag v1.46.0 2026-06-02 17:07:56 +00:00
github-actions[bot] a294d943e6 Merge main into release for tag v1.45.5 2026-06-02 11:36:44 +00:00
github-actions[bot] 9a8ccf6f6c Merge main into release for tag v1.45.4 2026-05-24 14:53:43 +00:00
github-actions[bot] f34e4cd369 Merge main into release for tag v1.45.3 2026-05-19 20:36:20 +00:00
github-actions[bot] 93e6de980d Merge main into release for tag v1.45.2 2026-05-14 12:40:17 +00:00
github-actions[bot] e6fe540cbc Merge main into release for tag v1.45.1 2026-05-14 09:47:51 +00:00
github-actions[bot] 23e6901046 Merge main into release for tag v1.45.0 2026-05-13 18:21:58 +00:00
Vanilagy 143ecea6c0 Merge branch 'main' into release 2026-05-10 17:51:36 +02:00
github-actions[bot] 067081d5eb Merge main into release for tag v1.44.2 2026-05-08 22:44:02 +00:00
github-actions[bot] f55a2b4764 Merge main into release for tag v1.44.1 2026-05-07 09:13:03 +00:00
Vanilagy 1b1c9a0299 Merge branch 'main' into release 2026-05-06 20:12:25 +02:00
github-actions[bot] 2b2e80dc24 Merge main into release for tag v1.44.0 2026-05-05 07:22:59 +00:00
Vanilagy 13d1e280e8 Merge branch 'main' into release 2026-05-04 10:53:26 +02:00
Vanilagy 62287156d6 Merge branch 'main' into release 2026-05-03 19:47:55 +02:00
github-actions[bot] 100852f266 Merge main into release for tag v1.43.1 2026-05-02 12:29:10 +00:00
github-actions[bot] f8f08a48e1 Merge main into release for tag v1.43.0 2026-04-30 08:39:05 +00:00
Vanilagy 71dd34fc3c Merge branch 'main' into release 2026-04-28 17:57:55 +02:00
github-actions[bot] 487ae3c69a Merge main into release for tag v1.42.0 2026-04-28 15:29:11 +00:00
github-actions[bot] 0d5bf18864 Merge main into release for tag v1.41.0 2026-04-24 17:46:40 +00:00
github-actions[bot] fc67e436e3 Merge main into release for tag v1.41.0 2026-04-24 17:44:40 +00:00
Vanilagy 735a6622a2 Merge branch 'main' into release 2026-04-01 17:20:33 +02:00
github-actions[bot] d51903edfe Merge main into release for tag v1.40.1 2026-03-24 10:17:07 +00:00
github-actions[bot] 6cdaa76fbb Merge main into release for tag v1.40.0 2026-03-19 21:42:33 +00:00
github-actions[bot] 8efe7e75db Merge main into release for tag v1.39.2 2026-03-13 10:05:14 +00:00
github-actions[bot] a892676453 Merge main into release for tag v1.39.1 2026-03-11 15:30:35 +00:00
github-actions[bot] 00f020921b Merge main into release for tag v1.39.0 2026-03-09 19:06:09 +00:00
github-actions[bot] 8071933f15 Merge main into release for tag v1.38.1 2026-03-07 08:40:38 +00:00
github-actions[bot] d97611453b Merge main into release for tag v1.38.0 2026-03-05 19:01:49 +00:00
github-actions[bot] 5e59ae4a1c Merge main into release for tag v1.37.0 2026-03-04 20:24:37 +00:00
github-actions[bot] 3b148f961a Merge main into release for tag v1.36.0 2026-03-04 16:13:56 +00:00
github-actions[bot] 95d60805ed Merge main into release for tag v1.36.0 2026-03-04 16:10:38 +00:00
github-actions[bot] 857956fb07 Merge main into release for tag v1.35.1 2026-02-26 20:49:45 +00:00
github-actions[bot] e9fc97e070 Merge main into release for tag v1.35.0 2026-02-25 16:24:03 +00:00
github-actions[bot] 15db8a27d4 Merge main into release for tag v1.34.5 2026-02-24 12:15:08 +00:00
Vanilagy 637d77b2cf Merge branch 'main' into release 2026-02-24 11:07:25 +01:00
github-actions[bot] b6bb382783 Merge main into release for tag v1.34.4 2026-02-17 11:37:33 +00:00
github-actions[bot] 7bb9961156 Merge main into release for tag v1.34.3 2026-02-16 20:06:09 +00:00
github-actions[bot] 776ae43f50 Merge main into release for tag v1.34.2 2026-02-12 17:55:25 +00:00
github-actions[bot] e533bab18a Merge main into release for tag v1.34.1 2026-02-12 17:50:59 +00:00
github-actions[bot] 26f3a576f3 Merge main into release for tag v1.34.0 2026-02-12 17:41:38 +00:00
github-actions[bot] 1f6457a50c Merge main into release for tag v1.34.0 2026-02-12 17:34:18 +00:00
github-actions[bot] f6aee7b414 Merge main into release for tag v1.33.0 2026-02-12 11:23:54 +00:00
github-actions[bot] 0cb4665d8e Merge main into release for tag v1.33.0 2026-02-12 11:13:21 +00:00
Vanilagy 525a03d220 Merge branch 'main' into release 2026-02-11 08:39:01 +01:00
Vanilagy 808422f4f5 Merge branch 'main' into release 2026-02-10 17:08:08 +01:00
github-actions[bot] e6110a5b9b Merge main into release for tag v1.32.2 2026-02-07 09:36:13 +00:00
github-actions[bot] cd2ded8767 Merge main into release for tag v1.32.1 2026-02-07 09:29:00 +00:00
github-actions[bot] db91d07780 Merge main into release for tag v1.32.0 2026-02-04 17:29:52 +00:00
github-actions[bot] af57c431d3 Merge main into release for tag v1.31.1 2026-02-03 14:54:52 +00:00
github-actions[bot] 049f24f2cb Merge main into release for tag v1.31.0 2026-01-27 13:39:24 +00:00
github-actions[bot] aa509cd62e Merge main into release for tag v1.30.1 2026-01-23 17:07:16 +00:00
github-actions[bot] 60789841a8 Merge main into release for tag v1.30.0 2026-01-23 12:53:16 +00:00
github-actions[bot] b6d3e3269d Merge main into release for tag v1.29.1 2026-01-20 19:13:22 +00:00
github-actions[bot] cea3a40902 Merge main into release for tag v1.29.0 2026-01-19 14:33:47 +00:00
github-actions[bot] 201a1b4066 Merge main into release for tag v1.28.0 2026-01-14 08:24:32 +00:00
github-actions[bot] 882051daf2 Merge main into release for tag v1.27.6 2026-01-12 15:48:35 +00:00
github-actions[bot] 91f96458fa Merge main into release for tag v1.27.5 2026-01-12 15:19:46 +00:00
Vanilagy 9d87a3e580 Merge branch 'main' into release 2026-01-12 10:32:50 +01:00
github-actions[bot] 040b0747be Merge main into release for tag v1.27.4 2026-01-06 12:38:15 +00:00
Vanilagy 53923e72dc Merge branch 'main' into release 2026-01-02 12:33:45 +01:00
github-actions[bot] 46b3ce39fb Merge main into release for tag v1.27.3 2025-12-30 15:22:33 +00:00
Vanilagy 14ae14b565 Merge branch 'main' into release 2025-12-30 14:11:52 +01:00
Vanilagy 70e3e98b53 Merge branch 'main' into release 2025-12-29 20:28:31 +01:00
github-actions[bot] 6b0527b691 Merge main into release for tag v1.27.2 2025-12-24 13:18:40 +00:00
Vanilagy 3e333636ec Merge branch 'main' into release 2025-12-23 20:16:55 +01:00
github-actions[bot] a583b9d168 Merge main into release for tag v1.27.1 2025-12-19 15:07:29 +00:00
github-actions[bot] 29aaaf64bc Merge main into release for tag v1.27.0 2025-12-17 14:38:30 +00:00
github-actions[bot] 5c45fd1f63 Merge main into release for tag v1.26.0 2025-12-11 19:45:19 +00:00
github-actions[bot] 7232296217 Merge main into release for tag v1.25.8 2025-12-09 13:26:37 +00:00
github-actions[bot] 30fc407c4c Merge main into release for tag v1.25.7 2025-12-05 22:03:54 +00:00
github-actions[bot] 52fd8d0e19 Merge main into release for tag v1.25.6 2025-12-04 15:58:34 +00:00
github-actions[bot] a3e43987ed Merge main into release for tag v1.25.5 2025-12-04 15:54:56 +00:00
github-actions[bot] 823ede1668 Merge main into release for tag v1.25.5 2025-12-04 15:49:12 +00:00
github-actions[bot] 1703e70a16 Merge main into release for tag v1.25.5 2025-12-04 15:45:20 +00:00
github-actions[bot] df0932d49e Merge main into release for tag v1.25.5 2025-12-04 15:41:44 +00:00
github-actions[bot] 64468b0e5b Merge main into release for tag v1.25.4 2025-12-04 09:05:03 +00:00
github-actions[bot] 903e36430f Merge main into release for tag v1.25.4 2025-12-04 09:00:14 +00:00
github-actions[bot] dbb4150718 Merge main into release for tag v1.25.3 2025-11-26 22:33:14 +00:00
github-actions[bot] 9d1f4a5f80 Merge main into release for tag v1.25.2 2025-11-25 16:28:37 +00:00
github-actions[bot] 76ac4e7aba Merge main into release for tag v1.25.1 2025-11-20 08:23:34 +00:00
github-actions[bot] f0be3ef134 Merge main into release for tag v1.25.0 2025-11-13 19:21:46 +00:00
github-actions[bot] 77fa426a9a Merge main into release for tag v1.24.7 2025-11-13 08:01:02 +00:00
github-actions[bot] b4cbf4c502 Merge main into release for tag v1.24.6 2025-11-11 21:30:53 +00:00
github-actions[bot] 27bdd33d42 Merge main into release for tag v1.24.5 2025-11-10 20:20:43 +00:00
github-actions[bot] 5972a5c906 Merge main into release for tag v1.24.4 2025-11-06 09:03:56 +00:00
Vanilagy da539cf495 Merge branch 'main' into release 2025-11-03 15:24:25 +01:00
Vanilagy 987ae467ce Merge branch 'main' into release 2025-11-03 12:12:38 +01:00
Vanilagy 2b5971d1ee Merge branch 'main' into release 2025-11-02 22:04:35 +01:00
github-actions[bot] d735f16ca5 Merge main into release for tag v1.24.3 2025-11-02 21:00:48 +00:00
github-actions[bot] 9926004401 Merge main into release for tag v1.24.2 2025-10-21 14:30:15 +00:00
github-actions[bot] 34628390b7 Merge main into release for tag v1.24.1 2025-10-20 14:14:12 +00:00
github-actions[bot] 1e46df030f Merge main into release for tag v1.24.0 2025-10-17 13:34:51 +00:00
github-actions[bot] a6fd297573 Merge main into release for tag v1.23.0 2025-10-02 14:03:04 +00:00
github-actions[bot] 447dd51e7b Merge main into release for tag v1.22.0 2025-10-02 09:34:06 +00:00
Vanilagy aebfede89a Merge branch 'main' into release 2025-10-01 17:32:31 +02:00
Vanilagy e0a1211140 Merge branch 'main' into release 2025-09-30 13:37:12 +02:00
github-actions[bot] aa8003e679 Merge main into release for tag v1.21.1 2025-09-29 19:03:27 +00:00
Vanilagy c74b6a44fb Merge branch 'main' into release 2025-09-29 09:58:12 +02:00
github-actions[bot] f21182a7b9 Merge main into release for tag v1.21.0 2025-09-26 14:39:15 +00:00
github-actions[bot] fb2dcba707 Merge main into release for tag v1.20.1 2025-09-26 08:07:45 +00:00
github-actions[bot] e25525a564 Merge main into release for tag v1.20.1 2025-09-26 08:02:50 +00:00
Vanilagy f356c05a9c Merge branch 'main' into release 2025-09-26 09:38:29 +02:00
github-actions[bot] 4e1428fcef Merge main into release for tag v1.20.0 2025-09-25 13:21:53 +00:00
github-actions[bot] ca48f31032 Merge main into release for tag v1.20.0 2025-09-25 13:18:15 +00:00
github-actions[bot] b958dd84cc Merge main into release for tag v1.19.1 2025-09-24 09:42:26 +00:00
Vanilagy f72db4dfa2 Merge branch 'main' into release 2025-09-22 22:06:18 +02:00
github-actions[bot] e9534f57c6 Merge main into release for tag v1.19.0 2025-09-22 20:03:41 +00:00
github-actions[bot] 31fdd363e3 Merge main into release for tag v1.18.1 2025-09-21 16:52:17 +00:00
github-actions[bot] 14a55fc476 Merge main into release for tag v1.18.0 2025-09-21 15:48:08 +00:00
Vanilagy 0fc3bb2b1d Merge branch 'main' into release 2025-09-19 14:32:44 +02:00
github-actions[bot] 4f670bbe06 Merge main into release for tag v1.17.3 2025-09-19 12:30:13 +00:00
github-actions[bot] 02f379d9c1 Merge main into release for tag v1.17.2 2025-09-19 12:04:29 +00:00
github-actions[bot] 588495268c Merge main into release for tag v1.17.1 2025-09-19 11:21:20 +00:00
github-actions[bot] 230778d887 Merge main into release for tag v1.17.0 2025-09-18 21:47:07 +00:00
github-actions[bot] 32267f348a Merge main into release for tag v1.16.1 2025-09-18 08:01:03 +00:00
github-actions[bot] 2aa0fd1433 Merge main into release for tag v1.16.0 2025-09-17 21:13:22 +00:00
Vanilagy bdc59306ed Merge branch 'main' into release 2025-09-17 09:12:11 +02:00
github-actions[bot] 03c1c46f9a Merge main into release for tag v1.15.2 2025-09-16 21:15:44 +00:00
github-actions[bot] b4f76fc082 Merge main into release for tag v1.15.1 2025-09-12 15:16:52 +00:00
github-actions[bot] d55431dda5 Merge main into release for tag v1.15.0 2025-09-12 15:01:03 +00:00
github-actions[bot] 6679b6b15d Merge main into release for tag v1.14.4 2025-09-10 21:04:34 +00:00
Vanilagy ad4dc659a5 Merge branch 'main' into release 2025-09-10 16:52:57 +02:00
github-actions[bot] 95fbec86e8 Merge main into release for tag v1.14.3 2025-09-09 11:11:50 +00:00
21 changed files with 182 additions and 47 deletions
+28
View File
@@ -0,0 +1,28 @@
name: Build check
on:
push:
branches:
- main
pull_request:
jobs:
build-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: 'npm'
- name: Install dependencies
run: npm ci
# Building the docs also means building the core library
- name: Build everything
run: npm run docs:build
+1 -4
View File
@@ -27,7 +27,4 @@ jobs:
run: npm run check
- name: Run ESLint
run: npm run lint
- name: Run build
run: npm run build
run: npm run lint
+12 -11
View File
@@ -25,15 +25,6 @@ jobs:
with:
script: "core.setFailed('Non-prerelease releases must target the main branch (got: ${{ github.event.release.target_commitish }}).')"
- name: Merge main into release branch
if: ${{ !github.event.release.prerelease }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout release
git merge origin/main --no-ff -m "Merge main into release for tag ${{ github.event.release.tag_name }}"
git push origin release
- name: Set up Node.js
uses: actions/setup-node@v4
with:
@@ -60,8 +51,9 @@ jobs:
- name: Run tests
run: xvfb-run npm test
- name: Run build
run: npm run build
# Building the docs also builds the core library
- name: Build everything
run: npm run docs:build
- name: Upload build artifacts
env:
@@ -106,3 +98,12 @@ jobs:
- name: Publish workspace packages to npm
run: npm publish --access public --workspaces ${{ github.event.release.prerelease && '--tag beta' || '' }}
- name: Merge main into release branch
if: ${{ !github.event.release.prerelease }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout release
git merge origin/main --no-ff -m "Merge main into release for tag ${{ github.event.release.tag_name }}"
git push origin release
+19
View File
@@ -26,6 +26,25 @@ Alternatively, directly include them using a script tag:
This will expose the global objects `Mediabunny` and `MediabunnyProres`. Use `mediabunny-prores.d.ts` to provide types for these globals. You can download the built distribution files from the [releases page](https://github.com/Vanilagy/mediabunny/releases).
## Setup
`@mediabunny/prores` can make use of shared-memory multithreading to achieve maximum performance. To enable this in browsers, your website must be cross-origin isolated by setting the following response headers:
```
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
```
Alternatively, you can use:
```
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: credentialless
```
which is generally more permissive but is not supported in Safari (of course).
---
If you cannot enable cross-origin isolation, `@mediabunny/prores` will fall back to a slower multithreading algorithm.
## Usage
```ts
+12 -12
View File
@@ -1,12 +1,12 @@
{
"name": "mediabunny",
"version": "1.50.0",
"version": "1.50.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mediabunny",
"version": "1.50.0",
"version": "1.50.3",
"license": "MPL-2.0",
"workspaces": [
".",
@@ -10963,9 +10963,9 @@
"optional": true
},
"node_modules/turbores": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/turbores/-/turbores-1.1.1.tgz",
"integrity": "sha512-uC2bBqMgMzeE/K4/zeUJd3IwvDm9+0JtNXkiBuc7Sg1L8OaeAhk+VCgoiqDgDdwVaqF3/lztEjrSgt8k15XyYw==",
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/turbores/-/turbores-1.1.4.tgz",
"integrity": "sha512-ZlWVTK+5m0KV0dytbOYozfJlNs5v7W7wWSBRVhbkY9mUjVA9bLHDvPH67bFBjUVTRDlU42dhClI6SZu8YTVs/A==",
"license": "MPL-2.0",
"funding": {
"type": "individual",
@@ -12894,7 +12894,7 @@
},
"packages/aac-encoder": {
"name": "@mediabunny/aac-encoder",
"version": "1.50.0",
"version": "1.50.3",
"license": "MPL-2.0",
"devDependencies": {
"@types/emscripten": "^1.40.1"
@@ -12909,7 +12909,7 @@
},
"packages/ac3": {
"name": "@mediabunny/ac3",
"version": "1.50.0",
"version": "1.50.3",
"license": "MPL-2.0",
"devDependencies": {
"@types/emscripten": "^1.40.1"
@@ -12924,7 +12924,7 @@
},
"packages/flac-encoder": {
"name": "@mediabunny/flac-encoder",
"version": "1.50.0",
"version": "1.50.3",
"license": "MPL-2.0",
"devDependencies": {
"@types/emscripten": "^1.40.1"
@@ -12939,7 +12939,7 @@
},
"packages/mp3-encoder": {
"name": "@mediabunny/mp3-encoder",
"version": "1.50.0",
"version": "1.50.3",
"license": "MPL-2.0",
"devDependencies": {
"@types/emscripten": "^1.40.1"
@@ -12954,10 +12954,10 @@
},
"packages/prores": {
"name": "@mediabunny/prores",
"version": "1.50.0",
"version": "1.50.3",
"license": "MPL-2.0",
"dependencies": {
"turbores": "^1.1.1"
"turbores": "^1.1.4"
},
"funding": {
"type": "individual",
@@ -12969,7 +12969,7 @@
},
"packages/server": {
"name": "@mediabunny/server",
"version": "1.50.0",
"version": "1.50.3",
"license": "MPL-2.0",
"dependencies": {
"@mediabunny/prores": "^1.50.0",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "mediabunny",
"author": "Vanilagy",
"version": "1.50.0",
"version": "1.50.3",
"description": "Pure TypeScript media toolkit for reading, writing, and converting media files, directly in the browser.",
"type": "module",
"workspaces": [
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@mediabunny/aac-encoder",
"author": "Vanilagy",
"version": "1.50.0",
"version": "1.50.3",
"description": "AAC encoder extension for Mediabunny, based on FFmpeg.",
"main": "./dist/bundles/mediabunny-aac-encoder.mjs",
"module": "./dist/bundles/mediabunny-aac-encoder.mjs",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@mediabunny/ac3",
"author": "Vanilagy",
"version": "1.50.0",
"version": "1.50.3",
"description": "AC-3 and E-AC-3 (Dolby Digital) decoder and encoder extension for Mediabunny, based on FFmpeg.",
"main": "./dist/bundles/mediabunny-ac3.mjs",
"module": "./dist/bundles/mediabunny-ac3.mjs",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@mediabunny/flac-encoder",
"author": "Vanilagy",
"version": "1.50.0",
"version": "1.50.3",
"description": "FLAC encoder extension for Mediabunny, based on libFLAC.",
"main": "./dist/bundles/mediabunny-flac-encoder.mjs",
"module": "./dist/bundles/mediabunny-flac-encoder.mjs",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@mediabunny/mp3-encoder",
"author": "Vanilagy",
"version": "1.50.0",
"version": "1.50.3",
"description": "MP3 encoder extension for Mediabunny, based on LAME.",
"main": "./dist/bundles/mediabunny-mp3-encoder.mjs",
"module": "./dist/bundles/mediabunny-mp3-encoder.mjs",
+19
View File
@@ -28,6 +28,25 @@ Alternatively, directly include them using a script tag:
This will expose the global objects `Mediabunny` and `MediabunnyProres`. Use `mediabunny-prores.d.ts` to provide types for these globals. You can download the built distribution files from the [releases page](https://github.com/Vanilagy/mediabunny/releases).
## Setup
`@mediabunny/prores` can make use of shared-memory multithreading to achieve maximum performance. To enable this in browsers, your website must be cross-origin isolated by setting the following response headers:
```
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
```
Alternatively, you can use:
```
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: credentialless
```
which is generally more permissive but is not supported in Safari (of course).
---
If you cannot enable cross-origin isolation, `@mediabunny/prores` will fall back to a slower multithreading algorithm.
## Usage
```ts
+2 -6
View File
@@ -1,7 +1,7 @@
{
"name": "@mediabunny/prores",
"author": "Vanilagy",
"version": "1.50.0",
"version": "1.50.3",
"description": "Apple ProRes decoder extension for Mediabunny, based on TurboRes.",
"main": "./dist/bundles/mediabunny-prores.mjs",
"module": "./dist/bundles/mediabunny-prores.mjs",
@@ -19,10 +19,6 @@
"src"
],
"sideEffects": false,
"browser": {
"node:worker_threads": false,
"node:os": false
},
"license": "MPL-2.0",
"repository": {
"type": "git",
@@ -38,7 +34,7 @@
"url": "https://github.com/sponsors/Vanilagy"
},
"dependencies": {
"turbores": "^1.1.1"
"turbores": "^1.1.4"
},
"peerDependencies": {
"mediabunny": "^1.49.0"
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@mediabunny/server",
"author": "Vanilagy",
"version": "1.50.0",
"version": "1.50.3",
"description": "Adds full video and audio decoder and encoder support to Mediabunny for use in server-side environments (Node, Bun, Deno). Based on NodeAV.",
"main": "./dist/bundles/mediabunny-server.cjs",
"module": "./dist/bundles/mediabunny-server.mjs",
+11 -1
View File
@@ -134,8 +134,18 @@ const generateDocs = (entryFiles: string[], apiConfigFile: string, dry = false)
if (aliasedDeclaration) {
const sourceFile = aliasedDeclaration.getSourceFile();
const moduleSymbol = typeChecker.getSymbolAtLocation(sourceFile);
if (moduleSymbol) {
// If the aliased declaration lives in a module we've already visited (e.g. a
// same-file `export type { Foo }` re-export of a local declaration), recursing
// won't reach it, so add the alias symbol directly. Otherwise follow the reexport.
if (moduleSymbol && !visited.has(moduleSymbol)) {
symbols.push(...getAllExportedSymbols(moduleSymbol, visited));
} else {
// Push the aliased symbol (not the alias) so downstream sees the real
// declaration and its JSDoc rather than the empty ExportSpecifier.
const hasPublicTag = ts.getJSDocTags(aliasedDeclaration).some(tag => tag.tagName.text === 'public');
if (hasPublicTag) {
symbols.push(aliasedSymbol);
}
}
}
}
+6 -2
View File
@@ -1329,9 +1329,13 @@ export class Conversion {
firstSample.close();
await tempOutput.finalize();
} catch (error) {
Logging._info('Error when probing encoder support. Falling back to rerender path.', error);
needsRerender = true;
Logging._warn(
'An error occurred when probing encoder support. Falling back to rerender path.', error,
);
void tempOutput.cancel();
needsRerender = true;
encodingConfig.transform.force = true;
}
} else {
await tempOutput.cancel();
+34
View File
@@ -46,6 +46,7 @@ import {
Rotation,
roundIfAlmostInteger,
textDecoder,
toDataView,
TRANSFER_CHARACTERISTICS_MAP_INVERSE,
UNDETERMINED_LANGUAGE,
} from '../misc';
@@ -141,6 +142,7 @@ type ClusterBlock = {
data: Uint8Array;
lacing: BlockLacing;
decoded: boolean;
postProcessed: boolean; // For codec-specific processing
mainAdditional: Uint8Array | null;
};
@@ -864,6 +866,7 @@ export class MatroskaDemuxer extends Demuxer {
data: frameData,
lacing: BlockLacing.None,
decoded: true,
postProcessed: false,
mainAdditional: originalBlock.mainAdditional,
});
}
@@ -1502,6 +1505,7 @@ export class MatroskaDemuxer extends Demuxer {
data: blockData,
lacing,
decoded: !hasDecodingInstructions,
postProcessed: false,
mainAdditional: null,
});
}; break;
@@ -1538,6 +1542,7 @@ export class MatroskaDemuxer extends Demuxer {
data: blockData,
lacing,
decoded: !hasDecodingInstructions,
postProcessed: false,
mainAdditional: null,
};
trackData.blocks.push(this.currentBlock);
@@ -2194,6 +2199,35 @@ abstract class MatroskaTrackBacking implements InputTrackBacking {
block.decoded = true;
}
if (!block.postProcessed) {
if (this.internalTrack.info?.codec === 'prores') {
// For some reason, ProRes packets are stored in Matroska without the frame container atom. FFmpeg cites
// the "Matroska spec" but the actual spec says nothing about this.
const hasFrameContainer = block.data.length >= 8
&& block.data[4] === 105 // 'i'
&& block.data[5] === 99 // 'c'
&& block.data[6] === 112 // 'p'
&& block.data[7] === 102; // 'f'
if (!hasFrameContainer) {
// Wrap the frame in a frame container
const newData = new Uint8Array(block.data.length + 8);
const newDataView = toDataView(newData);
newDataView.setUint32(0, newData.length, false);
newData[4] = 105; // 'i'
newData[5] = 99; // 'c'
newData[6] = 112; // 'p'
newData[7] = 102; // 'f'
newData.set(block.data, 8);
block.data = newData;
}
}
block.postProcessed = true;
}
const data = options.metadataOnly ? PLACEHOLDER_DATA : block.data;
const timestamp = block.timestamp / this.internalTrack.segment.timestampFactor;
const duration = block.duration / this.internalTrack.segment.timestampFactor;
+12 -1
View File
@@ -897,6 +897,17 @@ export class MatroskaMuxer extends Muxer {
try {
const trackData = this.getVideoTrackData(track, packet, meta);
let packetData = packet.data;
if (track.source._codec === 'prores') {
if (packetData.byteLength < 8) {
throw new Error('ProRes packet too small, expected at least 8 bytes.');
}
// Trim off the frame container atom header. FFmpeg does this too and cites the "Matroska spec" as the
// reason, despite the spec not saying anything about this.
packetData = packetData.subarray(8);
}
const isKeyFrame = packet.type === 'key';
this.validateTimestamp(trackData.track, packet.timestamp, isKeyFrame);
@@ -913,7 +924,7 @@ export class MatroskaMuxer extends Muxer {
? packet.sideData.alpha ?? null
: null;
const videoChunk = this.createInternalChunk(packet.data, timestamp, duration, packet.type, additions);
const videoChunk = this.createInternalChunk(packetData, timestamp, duration, packet.type, additions);
if (track.source._codec === 'vp9') this.fixVP9ColorSpace(trackData, videoChunk);
trackData.chunkQueue.push(videoChunk);
+4
View File
@@ -36,6 +36,7 @@ import {
setUint24,
toUint8Array,
UnthrottledTimerHandle,
wait,
} from './misc';
import { Muxer } from './muxer';
import { SubtitleParser } from './subtitles';
@@ -878,6 +879,9 @@ class VideoEncoderWrapper {
// These are wired in series, therefore they must also be flushed in series
await this.encoder.flush();
await this.alphaEncoder?.flush();
// Workaround for https://issues.chromium.org/issues/529852980 to give it time for errors to surface
await wait(25);
}
if (this.encoder.state !== 'closed') {
+1 -1
View File
@@ -354,7 +354,7 @@ test('MPEG-TS seeking race condition test', async () => {
}
});
test('MPEG-TS video key packets', { timeout: 10_000 }, async () => {
test('MPEG-TS video key packets', { timeout: 30_000 }, async () => {
for (let i = 0; i < 2; i++) {
using input = new Input({
source: new FilePathSource(path.join(__dirname, '../public/trim-buck-bunny-ffmpeg.ts')),
+13 -1
View File
@@ -7,7 +7,7 @@ import { Output } from '../../src/output.js';
import { MkvOutputFormat, MovOutputFormat } from '../../src/output-format.js';
import { BufferTarget } from '../../src/target.js';
import { Conversion } from '../../src/conversion.js';
import { VideoSampleSink } from '../../src/media-sink.js';
import { EncodedPacketSink, VideoSampleSink } from '../../src/media-sink.js';
import { assert } from '../../src/misc.js';
const SAMPLE_URL = 'https://pub-1ee78aacb848486482b20a72b55b3121.r2.dev/turbores-sample.mov';
@@ -88,6 +88,10 @@ test.concurrent('ProRes transmuxing into MKV', { timeout: 10_000 }, async () =>
});
await conversion.execute();
// No 'icpf' means the frame container atom headers were successfully stripped from the ProRes packets
let str = new TextDecoder('ascii').decode(output.target.buffer!);
expect(str.includes('icpf')).toBe(false);
using newInput = new Input({
source: new BufferSource(output.target.buffer!),
formats: ALL_FORMATS,
@@ -100,6 +104,14 @@ test.concurrent('ProRes transmuxing into MKV', { timeout: 10_000 }, async () =>
const decoderConfig = (await videoTrack.getDecoderConfig())!;
expect(decoderConfig.codec).toBe('apch');
expect(decoderConfig.description).toBeUndefined();
const sink = new EncodedPacketSink(videoTrack);
const firstPacket = await sink.getFirstPacket();
assert(firstPacket);
// The frame container atom headers are added back when reading out the packets
str = new TextDecoder('ascii').decode(firstPacket.data);
expect(str.includes('icpf')).toBe(true);
});
test('Custom coder registration', { timeout: 10_000 }, async () => {
+2 -2
View File
@@ -801,7 +801,7 @@ describe('Video', async () => {
await conversionRoundtrip('av1');
});
test('ProRes conversion roundtrip', { timeout: 20_000 }, async () => {
test('ProRes conversion roundtrip', { timeout: 30_000 }, async () => {
await conversionRoundtrip('prores');
});
@@ -1061,7 +1061,7 @@ describe('Video', async () => {
});
// https://github.com/Vanilagy/mediabunny/issues/392
test('Memory doesn\'t leak', async () => {
test('Memory doesn\'t leak', { timeout: 10_000 }, async () => {
const encoder = new NodeAvVideoEncoder();
// @ts-expect-error Readonly
encoder.codec = 'avc';