RootEncoder icon indicating copy to clipboard operation
RootEncoder copied to clipboard

Hardware and Software acceleration

Open RedwanSharafatKabir opened this issue 1 year ago • 1 comments

Does this library support hardware acceleration? If it does, how to enable software acceleration in which devices don't support hardware acceleration?

RedwanSharafatKabir avatar Dec 14 '24 13:12 RedwanSharafatKabir

Hello,

The library support software and hardware acceleration. This depend of the Codec selected by MediaCodec class. You can force one type of codec with this method:

// by default use CodecUtil.CodecType.FIRST_COMPATIBLE_FOUND
genericStream.forceCodecType(codecTypeVideo = CodecUtil.CodecType.HARDWARE, codecTypeAudio = CodecUtil.CodecType.HARDWARE)
genericStream.forceCodecType(codecTypeVideo = CodecUtil.CodecType.SOFTWARE, codecTypeAudio = CodecUtil.CodecType.SOFTWARE)

If your device can't find a codec compatible with the type required the prepareVideo or prepareAudio methods will return false.

pedroSG94 avatar Dec 16 '24 07:12 pedroSG94