5

Does anyone know what the supported resolutions are for Android MediaCodec when decoding HEVC?

Through trial and error I've found that the following work:

640x272
720x304
960x400
1280x528
1920x800
2560x1072

And the following don't:

512x216
3840x1600

Is there any official documentation?

Jack
  • 2,153
  • 5
  • 28
  • 43

1 Answers1

3

I doubt that there is any official documentation - in practice, you can probably rely on the fact that the resolutions that are tested by the CTS work, but other resolutions can behave in any way.

Judging from Android MediaCodec for HEVC, I guess you're testing with a device which only has got the SW decoder. I would actually guess that the real HW decoders would be more capable or more compatible, than the SW decoder. (This may sound counterintuitive, but this is especially the case historically with the H264 SW encoder, which is very limited.)

The first non-working resolution has a height that isn't dividable by 16 (all the working resolutions have both width and height dividable by 16), while the other one might be "too large". Does that hypothesis seem to hold up if you test more resolutions?

Community
  • 1
  • 1
mstorsjo
  • 12,983
  • 2
  • 39
  • 62
  • That hypothesis sounds good - sadly I don't have any more resolutions to test out right now. It sounds promising that hardware decoders support more resolutions, I should be getting a device with a hardware decoder soon :). Thanks! – Jack Jan 21 '15 at 15:10
  • I tried encoding HEVC videos (using x265) in different resolutions, and the SW HEVC decoder (`OMX.google.hevc.decoder` on a Nexus 9) seems to be able to handle them just fine, e.g. 512x216. So the resolution itself isn't the issue, not the sole issue at least. Can you check with a tool like `ffprobe` if the non-working videos use some other features, like range extensions (which is used for other subsampling types like 4:2:2 instead of the usual 4:2:0) or higher bitdepth (like 10 or 12 bits per channel instead of the usual 8)? – mstorsjo Jan 23 '15 at 23:52
  • @mstorsjo Hello, you said that you managed to encode h265 video, How did you make it? Did you use android API MediaCodec? – dragonfly Aug 04 '15 at 12:35
  • I encoded using libav/avconv with libx265, on normal linux, not on Android at all. – mstorsjo Aug 04 '15 at 17:49
  • If you are using Surface or texture where you are writing output, it is possible that you are running into power-of-2 texture issue, if you are targeting older version of GLES. – Ketan Jul 18 '17 at 00:33