What video encoder gives best performance on an Android device for given quality?

4.1k views Asked by At

I'm trying to determine the best encoder or encoding parameters to play as high resolution (quality) video on an Android phone as possible. I do not care much about file size, it can be triple the size of a "properly compressed" video as long as it plays smoothly. All encoders are optimized for best quality in as a small file as possible by default at the expense of computing power needed to decode the video - I'd like to optimize for computing power at the expense of file size.

So essentially I'd like to know how to effectively unburden the decoder at the expense of increasing the file size so the video plays without any artifacts or freezes.

Can anyone recommend a technique to achieve this?

To clarify: I have a locally available file in very high quality (1440p) which I'd like to transcode to as much playable resolution/quality as possible while not caring about file size (1080p+).

Thank you.

1

There are 1 answers

0
Morrison Chang On

For encoding video the general recommendation is to use H.264 with Baseline Profile for broad compatibility. There are a variety of parameters generally for optimizing for video content (animation vs static lecture vs action/sports), but generally resolves down to bitrate.

Any device which has Google Play must conform to the the Android Compatibility Definition Document which spells out what are the expect frame rate and bit rate for various sized videos:

http://source.android.com/compatibility/7.0/android-7.0-cdd.html#5_3_4_h_264

Android device implementations with H.264 decoders:

  • MUST support Main Profile Level 3.1 and Baseline Profile.
    Support for ASO (Arbitrary Slice Ordering), FMO (Flexible Macroblock Ordering) and RS (Redundant Slices) is OPTIONAL.
  • MUST be capable of decoding videos with the SD (Standard Definition) profiles listed in the following table and encoded with the Baseline Profile and Main Profile Level 3.1 (including 720p30).
  • SHOULD be capable of decoding videos with the HD (High Definition) profiles as indicated in the following table.
  • In addition, Android Television devices—
    • MUST support High Profile Level 4.2 and the HD 1080p60 decoding profile.
    • MUST be capable of decoding videos with both HD profiles as indicated in the following table and encoded with either the Baseline Profile, Main Profile, or the High Profile Level 4.2

                    SD (Low quality)    SD (High quality)   HD 720p         HD 1080p
Video resolution    320 x 240 px        720 x 480 px        1280 x 720 px   1920 x 1080 px
Video frame rate    30 fps              30 fps              30 fps          30 fps
Video bitrate       800 Kbps            2 Mbps              8 Mbps          20 Mbps

while Android has must requirements for SD video, HD is should but most likely implemented in high end devices.

With regards to power usage - with hardware decoding relatively common on high end devices - the screen is still the most power hungry part of playing a video so any thoughts about 'compression' should be in regards to what settings will provide the most visually acceptable content while being as small as possible. Given variations in content the 'right' settings usually require a bit of experimentation.

In addition if you are delivering to a device you should allow the client to pick the resolution/quality which makes sense - i.e. no reason to deliver a 1080p file to a 640x480 device.