mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 02:43:48 +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:
+15
-9
@@ -107,15 +107,15 @@
|
||||
/*
|
||||
video: {
|
||||
discard: true,
|
||||
bitrate: Mediabunny.QUALITY_VERY_HIGH,
|
||||
//bitrate: Mediabunny.QUALITY_VERY_HIGH
|
||||
quality: new Mediabunny.Quality('very-high'),
|
||||
//quality: new Mediabunny.Quality('very-high')
|
||||
codec: 'av1',
|
||||
//width: 800,
|
||||
//fit: 'fill',
|
||||
//rotate: 90,
|
||||
},
|
||||
audio: {
|
||||
bitrate: Mediabunny.QUALITY_HIGH,
|
||||
quality: new Mediabunny.Quality('high'),
|
||||
codec: 'aac',
|
||||
},
|
||||
*/
|
||||
@@ -129,10 +129,15 @@
|
||||
},
|
||||
*/
|
||||
video: {
|
||||
process: (sample) => {
|
||||
sample.draw(ctx, 0, 0, 1280, 720);
|
||||
return new Mediabunny.VideoSample(canvas, { timestamp: sample.timestamp, duration: sample.duration });
|
||||
},
|
||||
codec: 'avc',
|
||||
bitrate: new Mediabunny.Quality({
|
||||
quality: Infinity,
|
||||
}),
|
||||
forceTranscode: true,
|
||||
//process: (sample) => {
|
||||
// sample.draw(ctx, 0, 0, 1280, 720);
|
||||
// return new Mediabunny.VideoSample(canvas, { timestamp: sample.timestamp, duration: sample.duration });
|
||||
//},
|
||||
},
|
||||
tags: {} ?? {
|
||||
title: 'Bigggy',
|
||||
@@ -152,8 +157,9 @@
|
||||
}
|
||||
},
|
||||
trim: {
|
||||
start: -2,
|
||||
end: 10,
|
||||
end: 20,
|
||||
//start: -2,
|
||||
//end: 10,
|
||||
//start: 300.14984567374756 - 100,
|
||||
//end: 310.1548298151939 - 100,
|
||||
//end: 10,
|
||||
|
||||
Reference in New Issue
Block a user