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
It should be copying lines for the height of the image, not the width.
Width happened to work since a lot of test videos are landscape.
  • Loading branch information
lannybroo committed Mar 2, 2024
1 parent a7bd6d0 commit 5ec2f79
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 5ec2f79

Please sign in to comment.