Skip to content Skip to sidebar Skip to footer

Android Media Codec Video Decoding

This is my first question so please let me know if I missed anything! Using Android API 16's new Media Codec implementation to try and decode a video so that I can send frames to b

Solution 1:

James, welcome to Stack Overflow (as a questioner)!

I have tried to toy with the MediaCodec class, it is terribly limited and poorly documented. However, check out this pretty solid post (and his linked github) by Cedric Fung. His github project should just work out of the box on an API-17 (JellyBean 4.2)+ device.

I'm sure you can determine what you need to change from there, although as I alluded to before, you have limited flexibility here with the current level of the API.

Regarding your specific problem, I think you are locking the UI with your media decoder calls, which is not recommended, You should be taking a threaded approach, and rather than setting -1 as your timeout, have a timeout of say 10000 and allow it to be called multiple times until it is active.

Hope this helps (although it has been months since you asked the question)!

Post a Comment for "Android Media Codec Video Decoding"