mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 19:03:46 +02:00
Explicitly throw for odd video dimensions for AVC and HEVC (closes #142)
This commit is contained in:
@@ -490,6 +490,15 @@ export const canEncodeVideo = async (
|
||||
return false;
|
||||
}
|
||||
|
||||
const hasOddDimension = width % 2 === 1 || height % 2 === 1;
|
||||
if (
|
||||
hasOddDimension
|
||||
&& (codec === 'avc' || codec === 'hevc')
|
||||
) {
|
||||
// Disallow odd dimensions for certain codecs
|
||||
return false;
|
||||
}
|
||||
|
||||
encoderConfig ??= buildVideoEncoderConfig({
|
||||
codec,
|
||||
width,
|
||||
|
||||
Reference in New Issue
Block a user