How to use VPU for encode decode

Hi all, we try to use VPU for encode and decode. We try to build ffmpeg using mpp. But we could no be successful yet. I know RK3566 is more powerful than CM4 SoC. but If you cannot help on doing this it is not enough. So, can we get any support on this. We have both OV5647 and GC2053. Also we try to play H265 and H264 stream. So, please help on this. Thanks.

VPU encode is available with gstreamer only. Rockchip started adding support for encoding in ffmpeg but removed it. GStreamer is cumbersome.

Encoding from OV5647, 640x480, 30FPS:
sudo gst-launch-1.0 v4l2src device=/dev/video0 io-mode=dmabuf ! 'video/x-raw,format=NV12,width=640,height=480,framerate=30/1' ! mpph264enc ! filesink location=test_640x480_30fps_h264.mp4

Decoding H264:
sudo gst-play-1.0 --videosink=rkximagesink test_640x480_30fps_h264.mp4

Thanks for your reply, do we need to build gstreamer with which options? Can you also help on this. Thanks.

It is outdated but it is a start:

Thanks for your help.