I'm looking into using the android MediaCodec class to decode HEVC. Are there any examples of projects that do this?
At present I configure the decoder with the following:
AMEDIAFORMAT_KEY_MIME: "video/hevc"
AMEDIAFORMAT_KEY_MAX_HEIGHT: 4320
AMEDIAFORMAT_KEY_MAX_WIDTH: 8192
AMEDIAFORMAT_KEY_HEIGHT: 1600
AMEDIAFORMAT_KEY_WIDTH: 3840
AMEDIAFORMAT_KEY_FRAME_RATE: 24
AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP: 1
When using this setup, I get no video output. I've also tried setting csd-0
, csd-1
and csd-2
to the VPS, SPS and PPS respectively, but have had no luck.
I get the following error in the console, but have been assured it is unrelated:
01-19 15:40:36.048: E/OMXNodeInstance(17230): OMX_GetExtensionIndex OMX.google.android.index.storeMetaDataInBuffers failed
01-19 15:40:36.048: E/ACodec(17230): [OMX.google.hevc.decoder] storeMetaDataInBuffers failed w/ err -2147483648
I have found that dequeueOutputBuffer
is always returning -1
. It appears that dequeueInputBuffer
is returning indices that have been queued by queueInputBuffer
before they are obtained from dequeueOutputBuffer
.
Has anyone managed to decode HEVC video on Android?