Should use getSupportedVideoSizes()
The both parameters width and height are used for
MediaRecorder#setVideoSize(). A resolution which is returned from
getSupportedPreviewSizes() may not be encoded by MediaRecorder.
That method returns resolutions which are supported at still camera
mode also. Therefor the first item of the resolutions is not always
supported by a video encoder. So getSupportedVideoSizes() must be
used for recording video instead of getSupportedPreviewSizes().
2 files changed