Compare commits

..
2 Commits
Author SHA1 Message Date
Vanilagy 08cf34ee0d Adjust README image sizes 2025-07-08 15:42:32 +02:00
Vanilagy 1b382d3e57 Improve unsupported encoder configuration error messages 2025-07-07 11:21:42 +02:00
5 changed files with 15 additions and 12 deletions
+3 -3
View File
@@ -5,7 +5,7 @@
[![](https://img.shields.io/npm/dm/mediabunny)](https://www.npmjs.com/package/mediabunny)
<div align="center">
<img src="./docs/public/mediabunny-logo.svg" height="180">
<img src="./docs/public/mediabunny-logo.svg" width="180" height="180">
</div>
Mediabunny is a JavaScript library for reading, writing, and converting media files (like MP4, WebM, MP3), directly in the browser. It aims to be a complete toolkit for high-performance media operations on the web. It's written from scratch in pure TypeScript, has zero dependencies, is very performant, and is extremely tree-shakable, meaning you only include what you use. You can think of it a bit like [FFmpeg](https://ffmpeg.org/), but built from the ground up for the web.
@@ -16,11 +16,11 @@ Mediabunny is a JavaScript library for reading, writing, and converting media fi
<div align="center">
<a href="https://www.gling.ai/" target="_blank">
<img src="./docs/public/sponsors/gling.svg" height="60" alt="Gling AI">
<img src="./docs/public/sponsors/gling.svg" width="60" height="60" alt="Gling AI">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://diffusion.studio/" target="_blank">
<img src="./docs/public/sponsors/diffusionstudio.png" height="60" alt="Diffusion Studio">
<img src="./docs/public/sponsors/diffusionstudio.png" width="60" height="60" alt="Diffusion Studio">
</a>
</div>
+3 -2
View File
@@ -21,7 +21,7 @@
chunked: true,
chunkSize: 2**20
});
const outputFormat = new Mediabunny.MovOutputFormat();
const outputFormat = new Mediabunny.Mp4OutputFormat();
const button = document.createElement('button');
button.textContent = 'Cancel';
@@ -38,7 +38,8 @@
target
}),
audio: {
codec: 'pcm-f64'
codec: 'opus',
bitrate: 128000,
//numberOfChannels: 1,
//sampleRate: 4000
//discard: true
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "mediabunny",
"version": "1.0.1",
"version": "1.0.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mediabunny",
"version": "1.0.1",
"version": "1.0.3",
"license": "MPL-2.0",
"dependencies": {
"@types/dom-mediacapture-transform": "^0.1.11",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "mediabunny",
"author": "Vanilagy",
"version": "1.0.1",
"version": "1.0.3",
"description": "Pure TypeScript media toolkit for reading, writing, and converting media files, directly in the browser.",
"type": "module",
"main": "./dist/mediabunny.js",
+6 -4
View File
@@ -416,8 +416,9 @@ class VideoEncoderWrapper {
const support = await VideoEncoder.isConfigSupported(encoderConfig);
if (!support.supported) {
throw new Error(
'This specific encoder configuration is not supported by this browser. Consider using another'
+ ' codec or changing your video parameters.',
`This specific encoder configuration (${encoderConfig.codec}, ${encoderConfig.bitrate} bps,`
+ ` ${encoderConfig.width}x${encoderConfig.height}) is not supported by this browser. Consider`
+ ` using another codec or changing your video parameters.`,
);
}
@@ -988,8 +989,9 @@ class AudioEncoderWrapper {
const support = await AudioEncoder.isConfigSupported(encoderConfig);
if (!support.supported) {
throw new Error(
'This specific encoder configuration not supported by this browser. Consider using another'
+ ' codec or changing your audio parameters.',
`This specific encoder configuration (${encoderConfig.codec}, ${encoderConfig.bitrate} bps,`
+ ` ${encoderConfig.numberOfChannels} channels, ${encoderConfig.sampleRate} Hz) is not`
+ ` supported by this browser. Consider using another codec or changing your audio parameters.`,
);
}