diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx index a41298e5..fd7b3207 100644 --- a/src/components/video-editor/VideoEditor.tsx +++ b/src/components/video-editor/VideoEditor.tsx @@ -1156,9 +1156,10 @@ export default function VideoEditor() { videoPlaybackRef.current?.pause(); } - const aspectRatioValue = getAspectRatioValue(aspectRatio); const sourceWidth = video.videoWidth || 1920; const sourceHeight = video.videoHeight || 1080; + const sourceAspectRatio = sourceHeight > 0 ? sourceWidth / sourceHeight : 16 / 9; + const aspectRatioValue = getAspectRatioValue(aspectRatio, sourceAspectRatio); // Get preview CONTAINER dimensions for scaling const playbackRef = videoPlaybackRef.current; @@ -1241,7 +1242,10 @@ export default function VideoEditor() { exportWidth = sourceWidth; exportHeight = sourceHeight; - if (aspectRatioValue === 1) { + if (aspectRatio === 'native') { + exportWidth = Math.floor(sourceWidth / 2) * 2; + exportHeight = Math.floor(sourceHeight / 2) * 2; + } else if (aspectRatioValue === 1) { // Square (1:1): use smaller dimension to avoid codec limits const baseDimension = Math.floor(Math.min(sourceWidth, sourceHeight) / 2) * 2; exportWidth = baseDimension; @@ -1544,7 +1548,13 @@ export default function VideoEditor() {