简体   繁体   English

在Jelly Bean MR2下找到MediaCodec支持的视频编码分辨率

[英]Find the MediaCodec supported video encoding resolutions under Jelly Bean MR2

Is there any way to get the MediaCodec video encoding supported resolutions under Jelly Bean MR2? 是否可以通过Jelly Bean MR2获得MediaCodec视频编码支持的分辨率?

For lollipop we can use the new getVideoCapabilities() method to find out all the supported video resolutions. 对于棒棒糖,我们可以使用新的getVideoCapabilities()方法来找出所有受支持的视频分辨率。 But for lower API levels couldn't find a way in the MediaCodec API. 但是对于较低的API级别,找不到MediaCodec API中的方法。

I'm aware of the CamcorderProfile class available since API 8 which can give some hints of what the hardware might support , but to use the camcorder profiles to resolve the encoder video resolutions seems to be a guess game without consistency which could fail easily on many devices. 我知道从API 8开始就可以使用CamcorderProfile类,该类可以提供一些有关硬件可能支持的提示,但是使用摄录机配置文件解析编码器视频分辨率似乎是一个没有一致性的猜测游戏,在许多情况下很容易失败设备。

If it's listed in the CDD then you can assume it. 如果CDD中列出那么您可以假定它。 If not, you have to try and see if it works. 如果没有,您必须尝试看看是否可行。

The screenrecord tool uses a retry-on-error scheme to deal with cases where the video encoder can't record at the display resolution, because there was no way to query for it back then. screenrecord工具使用重试的错误方式来处理的情况下,视频编码器不能显示分辨率记录,因为没有办法查询它当时的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM