如何在安卓系统中使用getSupportedVideoSizes()函数?

3

我想录制视频,但它以非常低的分辨率录制。

我知道设置视频分辨率的方式是:

MediaRecorder recorder; recorder.setVideoSize(int width, int height);

好的,但我想获得设备支持的视频分辨率并将其设置为recorder.setVideoSize(int width, int height);

我知道可以使用getSupportedVideoSizes()来获取它,但我真的不知道如何获得视频分辨率,以及做一些显示这些视频分辨率并选择然后设置它们到recorder.setVideoSize(int width, int height);的操作。

请帮帮我,我已经尝试了很多次!

1个回答

2
尝试以下代码片段:
CamcorderProfile profile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);
recorder.setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight);

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接