支持的视频大小MediaRecorder API android [英] Supported video sizes MediaRecorder API android

查看:243
本文介绍了支持的视频大小MediaRecorder API android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用mediarecorder和mediaprojection api记录屏幕内容.当我尝试在设备上将视频更改为HD时,录制失败,但在640 x 480分辨率下可以正常工作.所以我的问题是如何在特定设备上获得受支持的视频分辨率? 干杯乔恩

I'm trying to record the contents of the screen using mediarecorder and mediaprojection api. When I'm trying to change the video to HD on my device the recording fails but it works fine with 640 x 480 resolution. So my question is how could I get the supported video resolutions on a particular device? Cheers Jon

推荐答案

如果您唯一感兴趣的是API 21+,则可以使用

If your only interest is in API 21+, you can use the getVideoCapabilities() method.

CamcorderProfile 类自API 8开始就存在没那么有用.

The CamcorderProfile class has been around since API 8, but isn't quite as useful.

如果其他所有方法均失败,请反复尝试,测试每个所需的分辨率并标记无效的分辨率.

If all else fails, use trial and error, testing each desired resolution and flagging the ones that don't work.

这篇关于支持的视频大小MediaRecorder API android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆