I started a project from Grafika and modified it. I\'ve got a framework (not too different from the original) which captures a preview from the Camera and conti
I'll answer that for myself just in case anyone else find it useful.
Apparently the issue only occurs on a few select chipsets such as MediaTek ones, which don't support non multiple of 16 resolutions. In my case it was 640x360 (where height is a multiple of 8). To partially solve it, I added a check in the App code, if the encoder is Omx.mtk, then reconfigure the encoder with width/height as the next multiple of 16, which comes out to be 640x368 in my case (closest to the requirement i.e. 360p).
For me, YouTube player adds a slight blanking on either side, which is the best we can do with those encoders.
In case you don't have dependency on any third party APIs/players etc