mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 10:53:50 +02:00
Add custom quality factors and quantizer bitrate mode (#448)
* Add custom quality factors and quantizer bitrate mode (closes #327) * Fix quantizer mode fallback and per-frame quantizer edge cases * Clean up quantizer mode tests * Quantizer implementation * Add quality tests * Improve conversion codec error message, make test more lenient * Add quantizer support blog post --------- Co-authored-by: Vanilagy <[email protected]>
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import {
|
||||
Input,
|
||||
ALL_FORMATS,
|
||||
BlobSource,
|
||||
UrlSource,
|
||||
Output,
|
||||
BufferTarget,
|
||||
Mp4OutputFormat,
|
||||
Conversion,
|
||||
QUALITY_VERY_LOW,
|
||||
Input,
|
||||
Mp4OutputFormat,
|
||||
Output,
|
||||
Quality,
|
||||
UrlSource,
|
||||
} from 'mediabunny';
|
||||
import { registerAc3Decoder } from '@mediabunny/ac3';
|
||||
import { registerProresDecoder } from '@mediabunny/prores';
|
||||
@@ -72,11 +72,11 @@ const compressFile = async (resource: File | string) => {
|
||||
tracks: 'primary', // Keep only one track per type
|
||||
video: {
|
||||
width: 320, // Height will be deduced automatically to retain aspect ratio
|
||||
bitrate: QUALITY_VERY_LOW,
|
||||
quality: new Quality('very-low'),
|
||||
},
|
||||
audio: {
|
||||
codec: 'opus',
|
||||
bitrate: QUALITY_VERY_LOW,
|
||||
quality: new Quality('very-low'),
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user