mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-03 13:53:53 +02:00
Fix invalid crop region for rotated video samples (fixes #151)
This commit is contained in:
+5
-4
@@ -24,7 +24,7 @@
|
|||||||
chunked: true,
|
chunked: true,
|
||||||
chunkSize: 2**20
|
chunkSize: 2**20
|
||||||
});
|
});
|
||||||
const outputFormat = new Mediabunny.Mp3OutputFormat({});
|
const outputFormat = new Mediabunny.Mp4OutputFormat({});
|
||||||
|
|
||||||
const button = document.createElement('button');
|
const button = document.createElement('button');
|
||||||
button.textContent = 'Cancel';
|
button.textContent = 'Cancel';
|
||||||
@@ -92,6 +92,7 @@
|
|||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
video: () => ({
|
video: () => ({
|
||||||
|
width: 300,
|
||||||
//alpha: 'keep',
|
//alpha: 'keep',
|
||||||
//width: 320,
|
//width: 320,
|
||||||
//discard: true,
|
//discard: true,
|
||||||
@@ -128,7 +129,7 @@
|
|||||||
//width: 200,
|
//width: 200,
|
||||||
//height: 100,
|
//height: 100,
|
||||||
}),
|
}),
|
||||||
tags: {
|
tags: {} ?? {
|
||||||
title: 'Bigggy',
|
title: 'Bigggy',
|
||||||
artist: 'Buck Bunny',
|
artist: 'Buck Bunny',
|
||||||
images: [{
|
images: [{
|
||||||
@@ -146,8 +147,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
trim: {
|
trim: {
|
||||||
start: 10,
|
start: 0,
|
||||||
//end: 20
|
end: 10
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
console.log(conversion);
|
console.log(conversion);
|
||||||
|
|||||||
+2
-2
@@ -620,8 +620,8 @@ export class VideoSample implements Disposable {
|
|||||||
const { sx, sy, sWidth, sHeight } = this._rotateSourceRegion(
|
const { sx, sy, sWidth, sHeight } = this._rotateSourceRegion(
|
||||||
options.crop?.left ?? 0,
|
options.crop?.left ?? 0,
|
||||||
options.crop?.top ?? 0,
|
options.crop?.top ?? 0,
|
||||||
options.crop?.width ?? this.codedWidth,
|
options.crop?.width ?? rotatedWidth,
|
||||||
options.crop?.height ?? this.codedHeight,
|
options.crop?.height ?? rotatedHeight,
|
||||||
rotation,
|
rotation,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user