Merge main into release for tag v1.50.1

This commit is contained in:
github-actions[bot]
2026-07-01 13:30:58 +00:00
12 changed files with 68 additions and 26 deletions
+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). 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 ## Usage
```ts ```ts
+12 -12
View File
@@ -1,12 +1,12 @@
{ {
"name": "mediabunny", "name": "mediabunny",
"version": "1.50.0", "version": "1.50.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "mediabunny", "name": "mediabunny",
"version": "1.50.0", "version": "1.50.1",
"license": "MPL-2.0", "license": "MPL-2.0",
"workspaces": [ "workspaces": [
".", ".",
@@ -10963,9 +10963,9 @@
"optional": true "optional": true
}, },
"node_modules/turbores": { "node_modules/turbores": {
"version": "1.1.1", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/turbores/-/turbores-1.1.1.tgz", "resolved": "https://registry.npmjs.org/turbores/-/turbores-1.1.2.tgz",
"integrity": "sha512-uC2bBqMgMzeE/K4/zeUJd3IwvDm9+0JtNXkiBuc7Sg1L8OaeAhk+VCgoiqDgDdwVaqF3/lztEjrSgt8k15XyYw==", "integrity": "sha512-6k3XH+sG8uOCJEBamKhAXFwIAfLqz7LAQr2mmEx2UBl6zC+4XAGQtp1fGEugnVl2w8Ec5GOUvD+b0tyxUJvmHg==",
"license": "MPL-2.0", "license": "MPL-2.0",
"funding": { "funding": {
"type": "individual", "type": "individual",
@@ -12894,7 +12894,7 @@
}, },
"packages/aac-encoder": { "packages/aac-encoder": {
"name": "@mediabunny/aac-encoder", "name": "@mediabunny/aac-encoder",
"version": "1.50.0", "version": "1.50.1",
"license": "MPL-2.0", "license": "MPL-2.0",
"devDependencies": { "devDependencies": {
"@types/emscripten": "^1.40.1" "@types/emscripten": "^1.40.1"
@@ -12909,7 +12909,7 @@
}, },
"packages/ac3": { "packages/ac3": {
"name": "@mediabunny/ac3", "name": "@mediabunny/ac3",
"version": "1.50.0", "version": "1.50.1",
"license": "MPL-2.0", "license": "MPL-2.0",
"devDependencies": { "devDependencies": {
"@types/emscripten": "^1.40.1" "@types/emscripten": "^1.40.1"
@@ -12924,7 +12924,7 @@
}, },
"packages/flac-encoder": { "packages/flac-encoder": {
"name": "@mediabunny/flac-encoder", "name": "@mediabunny/flac-encoder",
"version": "1.50.0", "version": "1.50.1",
"license": "MPL-2.0", "license": "MPL-2.0",
"devDependencies": { "devDependencies": {
"@types/emscripten": "^1.40.1" "@types/emscripten": "^1.40.1"
@@ -12939,7 +12939,7 @@
}, },
"packages/mp3-encoder": { "packages/mp3-encoder": {
"name": "@mediabunny/mp3-encoder", "name": "@mediabunny/mp3-encoder",
"version": "1.50.0", "version": "1.50.1",
"license": "MPL-2.0", "license": "MPL-2.0",
"devDependencies": { "devDependencies": {
"@types/emscripten": "^1.40.1" "@types/emscripten": "^1.40.1"
@@ -12954,10 +12954,10 @@
}, },
"packages/prores": { "packages/prores": {
"name": "@mediabunny/prores", "name": "@mediabunny/prores",
"version": "1.50.0", "version": "1.50.1",
"license": "MPL-2.0", "license": "MPL-2.0",
"dependencies": { "dependencies": {
"turbores": "^1.1.1" "turbores": "^1.1.2"
}, },
"funding": { "funding": {
"type": "individual", "type": "individual",
@@ -12969,7 +12969,7 @@
}, },
"packages/server": { "packages/server": {
"name": "@mediabunny/server", "name": "@mediabunny/server",
"version": "1.50.0", "version": "1.50.1",
"license": "MPL-2.0", "license": "MPL-2.0",
"dependencies": { "dependencies": {
"@mediabunny/prores": "^1.50.0", "@mediabunny/prores": "^1.50.0",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "mediabunny", "name": "mediabunny",
"author": "Vanilagy", "author": "Vanilagy",
"version": "1.50.0", "version": "1.50.1",
"description": "Pure TypeScript media toolkit for reading, writing, and converting media files, directly in the browser.", "description": "Pure TypeScript media toolkit for reading, writing, and converting media files, directly in the browser.",
"type": "module", "type": "module",
"workspaces": [ "workspaces": [
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@mediabunny/aac-encoder", "name": "@mediabunny/aac-encoder",
"author": "Vanilagy", "author": "Vanilagy",
"version": "1.50.0", "version": "1.50.1",
"description": "AAC encoder extension for Mediabunny, based on FFmpeg.", "description": "AAC encoder extension for Mediabunny, based on FFmpeg.",
"main": "./dist/bundles/mediabunny-aac-encoder.mjs", "main": "./dist/bundles/mediabunny-aac-encoder.mjs",
"module": "./dist/bundles/mediabunny-aac-encoder.mjs", "module": "./dist/bundles/mediabunny-aac-encoder.mjs",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@mediabunny/ac3", "name": "@mediabunny/ac3",
"author": "Vanilagy", "author": "Vanilagy",
"version": "1.50.0", "version": "1.50.1",
"description": "AC-3 and E-AC-3 (Dolby Digital) decoder and encoder extension for Mediabunny, based on FFmpeg.", "description": "AC-3 and E-AC-3 (Dolby Digital) decoder and encoder extension for Mediabunny, based on FFmpeg.",
"main": "./dist/bundles/mediabunny-ac3.mjs", "main": "./dist/bundles/mediabunny-ac3.mjs",
"module": "./dist/bundles/mediabunny-ac3.mjs", "module": "./dist/bundles/mediabunny-ac3.mjs",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@mediabunny/flac-encoder", "name": "@mediabunny/flac-encoder",
"author": "Vanilagy", "author": "Vanilagy",
"version": "1.50.0", "version": "1.50.1",
"description": "FLAC encoder extension for Mediabunny, based on libFLAC.", "description": "FLAC encoder extension for Mediabunny, based on libFLAC.",
"main": "./dist/bundles/mediabunny-flac-encoder.mjs", "main": "./dist/bundles/mediabunny-flac-encoder.mjs",
"module": "./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", "name": "@mediabunny/mp3-encoder",
"author": "Vanilagy", "author": "Vanilagy",
"version": "1.50.0", "version": "1.50.1",
"description": "MP3 encoder extension for Mediabunny, based on LAME.", "description": "MP3 encoder extension for Mediabunny, based on LAME.",
"main": "./dist/bundles/mediabunny-mp3-encoder.mjs", "main": "./dist/bundles/mediabunny-mp3-encoder.mjs",
"module": "./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). 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 ## Usage
```ts ```ts
+2 -6
View File
@@ -1,7 +1,7 @@
{ {
"name": "@mediabunny/prores", "name": "@mediabunny/prores",
"author": "Vanilagy", "author": "Vanilagy",
"version": "1.50.0", "version": "1.50.1",
"description": "Apple ProRes decoder extension for Mediabunny, based on TurboRes.", "description": "Apple ProRes decoder extension for Mediabunny, based on TurboRes.",
"main": "./dist/bundles/mediabunny-prores.mjs", "main": "./dist/bundles/mediabunny-prores.mjs",
"module": "./dist/bundles/mediabunny-prores.mjs", "module": "./dist/bundles/mediabunny-prores.mjs",
@@ -19,10 +19,6 @@
"src" "src"
], ],
"sideEffects": false, "sideEffects": false,
"browser": {
"node:worker_threads": false,
"node:os": false
},
"license": "MPL-2.0", "license": "MPL-2.0",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -38,7 +34,7 @@
"url": "https://github.com/sponsors/Vanilagy" "url": "https://github.com/sponsors/Vanilagy"
}, },
"dependencies": { "dependencies": {
"turbores": "^1.1.1" "turbores": "^1.1.2"
}, },
"peerDependencies": { "peerDependencies": {
"mediabunny": "^1.49.0" "mediabunny": "^1.49.0"
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@mediabunny/server", "name": "@mediabunny/server",
"author": "Vanilagy", "author": "Vanilagy",
"version": "1.50.0", "version": "1.50.1",
"description": "Adds full video and audio decoder and encoder support to Mediabunny for use in server-side environments (Node, Bun, Deno). Based on NodeAV.", "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", "main": "./dist/bundles/mediabunny-server.cjs",
"module": "./dist/bundles/mediabunny-server.mjs", "module": "./dist/bundles/mediabunny-server.mjs",
+6 -2
View File
@@ -1329,9 +1329,13 @@ export class Conversion {
firstSample.close(); firstSample.close();
await tempOutput.finalize(); await tempOutput.finalize();
} catch (error) { } catch (error) {
Logging._info('Error when probing encoder support. Falling back to rerender path.', error); Logging._warn(
needsRerender = true; 'An error occurred when probing encoder support. Falling back to rerender path.', error,
);
void tempOutput.cancel(); void tempOutput.cancel();
needsRerender = true;
encodingConfig.transform.force = true;
} }
} else { } else {
await tempOutput.cancel(); await tempOutput.cancel();
+4
View File
@@ -36,6 +36,7 @@ import {
setUint24, setUint24,
toUint8Array, toUint8Array,
UnthrottledTimerHandle, UnthrottledTimerHandle,
wait,
} from './misc'; } from './misc';
import { Muxer } from './muxer'; import { Muxer } from './muxer';
import { SubtitleParser } from './subtitles'; import { SubtitleParser } from './subtitles';
@@ -878,6 +879,9 @@ class VideoEncoderWrapper {
// These are wired in series, therefore they must also be flushed in series // These are wired in series, therefore they must also be flushed in series
await this.encoder.flush(); await this.encoder.flush();
await this.alphaEncoder?.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') { if (this.encoder.state !== 'closed') {