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 continuously encodes it to a video at the same time both at different resolutions.
MediaCodec
(for encoding) is configured to use COLOR_FormatSurface
in order for us to be able to render to the Surface queried using getInputSurface()
using GLES.
The media format is set to MIME Type video/avc
For most phones, this setup works perfectly.
But for a few phones, the encoded video has the chrominance values slightly skewed and a green bar at the bottom.
Currently the encoder surface is of 640x360 resolution. EGLConfig choosen to render to the surface supports 32 bit RGBA format.
The preview is perfect in all phones.
So I am assuming there's some thing wrong with the encoder parameters either on the application side or the OS framework side.
It's happening on Android 4.4. - Not sure, if it's reproducible on 5.*.
]2
640x360
the encoding resolution also? Are you encoding1080p
? If so, then I think your issue is due to alignment vertically. The encoder may be reading 1088 instead of 1080. If so, the camera output should be aligned similarly. – Inextirpable1080
, but I am getting same issue on a MediaTek chipset device. I have tried encoding at1072
, and that seems fine. But I don't want to go with this solution, for several reasons - 1) Non standard resolution, 2) How to decide which device encodes at1080
and which of them require1072
, 3) Other issues may crop up (exporting at1088
fixed this issue, but added other issues) Thanks a lot in advance! – Manlove