I\'m working on an app which encodes a movie using h.264 encoder to gallery and other targets. This app supports variable aspect ratios at output (1:1, 2:3, 3:2, 16:9, 3:4,
I believe it has something to do with the device's chipset. I have the exact same problem with an old Motorola XT1058, which uses a Qualcomm Snapdragon S4 Pro, the same chipset as the Nexus 7.
Doing some research I discovered through another answer that in older Qualcomm devices YUV data needs to be aligned at a 2K boundary, yet I can't understand how to fix it when using a input surface instead of YUV buffers.
See the next accepted answer for the statement about the Qualcomm alignment requirements:
How to get stride and Y plane alignment values for MediaCodec encoder
My workaround is that for older devices I will use resolutions which I know will work, these are the ones that I can obtain by querying video profiles with the CamcorderProfile API.
The main problem is how to detect if a device is affected or not, as the MediaCodec API can give only the codec name but not its version.