Skip to content

Commit

Permalink
fix: FrameConverter only copies upper square on portrait-format video (
Browse files Browse the repository at this point in the history
…#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.
  • Loading branch information
lannybroo authored Mar 11, 2024
1 parent d05758b commit a363f5f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a363f5f

Please sign in to comment.