Check if android device support 4K video?
Asked Answered
C

2

9

I am trying to play a 4K video in my application, but as long as all devices can not play 4K videos I'm having some troubles.

  • How can I check at runtime if that device support it or not before playing the video?
Copper answered 15/6, 2015 at 12:4 Comment(5)
i have tried R&D on it for hours but can't find it any data regarding this issue... i just want to know if phone support it or not?Copper
What do you mean when you say device supports 4k videos? Do you mean if the device have the resources to play the video?Laborer
@Jordi Castilla minSdkVersion please? Alos, let me know if you are using Camera2API api also?Culmiferous
How do you play the video? System apis or a custom player?Cachet
How did you test it, can you please share whole method?Feast
N
8

First of all, you have to remember 4k is just a resolution, but you have to also remember about bitrate.

Here's a method to test whether resolution/bitrate combination is achievable on a certain device:

boolean areSizeAndRateSupported (int width, int height, double frameRate)

https://developer.android.com/reference/android/media/MediaCodecInfo.VideoCapabilities.html#areSizeAndRateSupported(int,%20int,%20double)

There's also:

isSizeSupported(int width, int height)

The only downside of these methods is that it's supported from API level 21.

You can also check codec capabilities using this method:

MediaCodecInfo.VideoCapabilities.getVideoCapabilities()

https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#getVideoCapabilities()

But as far as I know, they can return lower resolution than actually supported.

From the other hand, in your case, devices below android lollipop most likely aren't fast enough to play 4k video. Or even if they can, their resolution is too low to actually get any benefit from 4k resolution.

So, in my opinion, the most elegant solution is to assume 4k is not supported below android 5.0 and use a method from above check whether it's supported on android 5.0+.

Northcliffe answered 2/3, 2017 at 8:27 Comment(0)
N
-1

You can download this app and get batter performance then other app this app will supports all formate of videos

aatmanirbhar bharat app https://play.google.com/store/apps/details?id=com.hdvideoplayer.elogic

Nonchalance answered 11/3, 2021 at 6:33 Comment(1)
not an solutionBenzoic

© 2022 - 2024 — McMap. All rights reserved.