Dela via


MediaCodecInfo.VideoCapabilities.GetAchievableFrameRatesFor Method

Definition

Returns the range of achievable video frame rates for a video size.

[Android.Runtime.Register("getAchievableFrameRatesFor", "(II)Landroid/util/Range;", "", ApiSince=23)]
public Android.Util.Range? GetAchievableFrameRatesFor (int width, int height);
[<Android.Runtime.Register("getAchievableFrameRatesFor", "(II)Landroid/util/Range;", "", ApiSince=23)>]
member this.GetAchievableFrameRatesFor : int * int -> Android.Util.Range

Parameters

width
Int32

the width of the video

height
Int32

the height of the video

Returns

Attributes

Remarks

Returns the range of achievable video frame rates for a video size. May return null, if the codec did not publish any measurement data.

This is a performance estimate provided by the device manufacturer based on statistical sampling of full-speed decoding and encoding measurements in various configurations of common video sizes supported by the codec. As such it should only be used to compare individual codecs on the device. The value is not suitable for comparing different devices or even different android releases for the same device.

<em>On android.os.Build.VERSION_CODES#M release</em> the returned range corresponds to the fastest frame rates achieved in the tested configurations. As such, it should not be used to gauge guaranteed or even average codec performance on the device.

<em>On android.os.Build.VERSION_CODES#N release</em> the returned range corresponds closer to sustained performance <em>in tested configurations</em>. One can expect to achieve sustained performance higher than the lower limit more than 50% of the time, and higher than half of the lower limit at least 90% of the time <em>in tested configurations</em>. Conversely, one can expect performance lower than twice the upper limit at least 90% of the time. <p class=note> Tested configurations use a single active codec. For use cases where multiple codecs are active, applications can expect lower and in most cases significantly lower performance. <p class=note> The returned range value is interpolated from the nearest frame size(s) tested. Codec performance is severely impacted by other activity on the device as well as environmental factors (such as battery level, temperature or power source), and can vary significantly even in a steady environment. <p class=note> Use this method in cases where only codec performance matters, e.g. to evaluate if a codec has any chance of meeting a performance target. Codecs are listed in MediaCodecList in the preferred order as defined by the device manufacturer. As such, applications should use the first suitable codec in the list to achieve the best balance between power use and performance.

Java documentation for android.media.MediaCodecInfo.VideoCapabilities.getAchievableFrameRatesFor(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to