Explicitly throw for odd video dimensions for AVC and HEVC (closes #142)

This commit is contained in:
Vanilagy
2025-09-22 15:37:31 +02:00
parent 6aee4e6a6a
commit f9a7735aae
4 changed files with 110 additions and 7 deletions
+9
View File
@@ -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,