OpenCV AI and Hardware video decoder acceleration (h264)

Hi All,

Using the NN on the VIM4 with static images is good, but what about video? How can I get hardware acceleration to work? I have set CAP_FFMPEG to enable ffmeg, but I cant find a way to force it to use hardware

I added in the environment - which seemed to do nothing…
export OPENCV_FFMPEG_CAPTURE_OPTIONS=“video_codec;h264_v4l2m2m”

        cv::VideoCapture cap("rtsp://192.168.10.145:8554/garden_low_cam",cv::CAP_FFMPEG);
        cap.set(cv::CAP_PROP_FRAME_WIDTH, default_width);
        cap.set(cv::CAP_PROP_FRAME_HEIGHT, default_height);

FFMPEG command line works with “-c:v h264_v4l2m2m” perfectly.

Has anyone managed to get hardware video decoders working on OpenCV on a VIM4N ?

Richard

I have managed to verify that hardware acceleration was being used… OpenCV and AML_NN is dog slow! I get 18mSec inference on a Coral - I get 66mSec with AML - I get 42mSec using the MALI GPU

It maxes out one core at 15 frames/second. Something is fundamentally wrong with this NPU

Maybe you can try Gstreamer?

https://docs.khadas.com/products/sbc/vim4/applications/hardware-decoding