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