Use hardware encoder - Andoird iMX8M Plus

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Use hardware encoder - Andoird iMX8M Plus

984 Views
avijitnsec
Contributor III

Hi, 

I am trying to develop an Android application on the iMX8M Plus board. It is a camera-based application. I am able to display camera data to display using camera 2 API as well as using the GStreamer library. But my CPU usage is very high. Now I am considering using the HW encoder. Can someone please guide me? I would like to use the HW encoder when using Android camera API and the GStreamer API. 

Here is my BoardConfig.mk (default) - 

BOARD_SOC_TYPE := IMX8MP
BOARD_HAVE_VPU := true
BOARD_VPU_TYPE := hantro
HAVE_FSL_IMX_GPU2D := false
HAVE_FSL_IMX_GPU3D := true
HAVE_FSL_IMX_PXP := false
TARGET_USES_HWC2 := true
TARGET_HAVE_VULKAN := true
 
SOONG_CONFIG_IMXPLUGIN += \
BOARD_VPU_TYPE
 
SOONG_CONFIG_IMXPLUGIN_BOARD_SOC_TYPE = IMX8MP
SOONG_CONFIG_IMXPLUGIN_BOARD_HAVE_VPU = true
SOONG_CONFIG_IMXPLUGIN_BOARD_VPU_TYPE = hantro
SOONG_CONFIG_IMXPLUGIN_BOARD_VPU_ONLY = false
 
Going forword, we would like to use NPU for AI processing from Android applications. I would appreciate it if there is any documentation available for the same.
 
Thanks,
Avijit
0 Kudos
Reply
3 Replies

935 Views
joanxie
NXP TechSupport
NXP TechSupport

for your own application, you can refer to the Nuplayer, which uses VPU on android

922 Views
avijitnsec
Contributor III

Thank you for the reply. Is there anything specific I need to do to use imx specific VPU. Is there any library I need to include in the gradle file? 

0 Kudos
Reply

872 Views
joanxie
NXP TechSupport
NXP TechSupport

 the source code of codecs in the android under:

i.MX OMX Codecs

•Binary: device/fsl-codec/lib/

•Source: external/fsl_imx_omx/

so you can refer to nxp android source code about using vpu