2

I google around the sample code for MediaCodec and notice there are three kinds of implementation in the market:

  1. Java version
  2. NDK version with raw MediaCodec API
  3. NDK version but FFmpeg takes care of everything

I guess Java version is different on the performance side and use less frequently, but 2 & 3 are very confusing.

If choose option 3, the work is easier and a noticeable change from SW decoding would be avcodec_find_decoder_by_name("h264_mediacodec"), and the implementation can easily share with iOS VideoToolBox.

My question is would it be any performance or device compatible drawbacks compared with raw MediaCodec API? Why did someone choose to use raw MediaCodec API?

Plus what if I use surface mode?

Michael
  • 1,313
  • 11
  • 25

0 Answers0