Was looking through the camera2 video sample app published by Google and one of the methods goes as following:
/**
* In this sample, we choose a video size with 3x4 aspect ratio. Also, we don't use sizes
* larger than 1080p, since MediaRecorder cannot handle such a high-resolution video.
*
* @param choices The list of available sizes
* @return The video size
*/
private static Size chooseVideoSize(Size[] choices) {
for (Size size : choices) {
if (size.getWidth() == size.getHeight() * 4 / 3 && size.getWidth() <= 1080) {
return size;
}
}
Log.e(TAG, "Couldn't find any suitable video size");
return choices[choices.length - 1];
}
I've fiddled with my own implementation of camera2 and attempted to record a 4K video with media recorder which worked fine - the recorded file reported dimensions of 3840 × 2160.
So, is the comment in the sample incorrect or MediaRecorder was not capable of handling larger resolutions on Lollipop but is capable on Marshmallow or something else?