Hardware decoder/encoder Banana Pi Banana Pi BPI-M4 Zero

Hello

I am looking for a solution to use the hardware decoder/encoder on the bananapi Banana Pi BPI-M4 Zero with Allwinner H618 in Linux.

so far i use the code: ffmpeg -input_format mjpeg -video_size 1920x1080 -i /dev/video0 -c:v libx264 -preset ultrafast -tune zerolatency -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH

but this loads the cpu to 100% and the image is not smooth