From a363f5fa10c1f08eea696303b7b3b6b5cfaf4b7b Mon Sep 17 00:00:00 2001 From: Alan Brooks Date: Mon, 11 Mar 2024 15:34:53 -0500 Subject: [PATCH] fix: FrameConverter only copies upper square on portrait-format video (#460) It should be copying lines for the height of the image, not the width. Width happened to work since most test videos are landscape. --- .../src/main/java/org/jmisb/api/video/FrameConverter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-ffmpeg/src/main/java/org/jmisb/api/video/FrameConverter.java b/api-ffmpeg/src/main/java/org/jmisb/api/video/FrameConverter.java index 2a6070c6e..c576048e0 100644 --- a/api-ffmpeg/src/main/java/org/jmisb/api/video/FrameConverter.java +++ b/api-ffmpeg/src/main/java/org/jmisb/api/video/FrameConverter.java @@ -53,7 +53,7 @@ public BufferedImage convert(AVFrame frame) { byte[] a = ((DataBufferByte) out).getData(); ByteBuffer src = - frame.data(0).capacity((long) frame.width() * (long) frame.linesize(0)).asBuffer(); + frame.data(0).capacity((long) frame.height() * (long) frame.linesize(0)).asBuffer(); copy(src, frame.linesize(0), ByteBuffer.wrap(a, start, a.length - start), step); return bufferedImage;