Jijo Varghese
Jijo Varghese

Reputation: 69

Compresson using MediaCodec

I'm compressing a media file ( decoding and encoding ) with mediaCodec API, I'm decoding it from a decoder of size 4MB (YUV format).

When I try to enqueue this decoded file to the encoder I'm getting an Illegal state Exception. Later, I found out hat the reason is that the encoder input buffer doesn't have the required buffer size. Is there anybody, who can sort out the problem?.

Upvotes: 0

Views: 250

Answers (1)

Jijo Varghese
Jijo Varghese

Reputation: 69

By default Input Buffer size is 112 KB, So if you got a decoder output of size bigger than this, you should manually fix this. By setting this constant MediaFormat.KEY_MAX_INPUT_SIZE

Upvotes: 1

Related Questions