[FFmpeg-devel] about mediacodec encoder on android platform

Matthieu Bouron matthieu.bouron at gmail.com
Tue Mar 31 11:40:43 EEST 2020


On Fri, Mar 27, 2020 at 04:21:59PM +0800, aistoy wrote:
> Hi, I want to know why ffmpeg do not include mediacodec encoder, just include mediacodec decoder. 
> And why the decoder implemention don’t use mediacodec native api, but use jni call mediacodec java methods. 
> If i plan to add the mediacodec encoder, what do you think i should pay attention to ?

Hi,

Sorry for the late replay.

The MediaCodec decoder wrapper in FFmpeg does not use the native API
because at the time it was implemented, more than 40% of the devices were
running Android 4.4 (which does not support the native API).

The MediaCodec native API has also some limitation regarding codec
probing, ie: it does not provide a wrapper around
MediaCodecList/MediaCodecInfo. We use this capability to blacklist
software codecs for example.

I made our MediaCodec java wrapper implement the same API as the native
one provided by the NDK so it shouldn't be too hard to switch.
Moreover, Aman Gupta already already did this work in one of his branches.

The "tricky" part about implementing MediaCodec encoding support in FFmpeg
will be to fit the encoder input surface API into the libavcodec API.

> thanks!
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".

-- 
Matthieu B.


More information about the ffmpeg-devel mailing list