roman10 / android-ffmpeg-tutorial

android-ffmpeg-tutorial

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scrambled Image with certain screen resolutions

thomasvamos opened this issue · comments

I ran tutorial02 on a HTC one with a screen resolution of 1080 x 1920 pixels. Now I get the behaviour as shown in the screenshot:
screenshot

The image is scrambled, the lines are somehow shifted towards the left. The Video works fine on other devices. I think the problem is that, the frameRGBA->linesize does not match with the windowBuffer.stride. In my case the first one is 1080 and the latter one 1088. Do you have an Idea what may be the error?

Thanks for your help.

commented

use ANativeWindow_setBuffersGeometry to set the buffer size

in tutorial02.c line 288:
remove: memcpy(windowBuffer.bits, buffer, width * height * 4);
add:
int y=0;
for(y=0;y<height;y++)
memcpy((uint8_t _)windowBuffer.bits+(y_windowBuffer.stride_4), buffer+y_width_4, width_4);

Hi guys, i got the same problem. Please suggest for me the solution to fix this issues..
Thanks..

Same here. What do I do?