Hardware acceleration Raspberry Pi 4

Hey there!

I have a Raspberry Pi CM4 that's running v21.02.03 of OpenWrt (32-bit version).

I am trying to encode video using the Video4Linux2 Memory to Memory (v4l2 m2m) API so that i can encode using hardware acceleration. On Raspbian, the v4l2 m2m api is loaded from the kernel module bcm2835-codec. However when i lsmod, i am unable to see it. Further, there doesn't seem to be an option to enable this module when building an OpenWrt image.

Has anyone had any success or knows how to enable load the bcm2835-codec kernel module so that i can use the v4l2 m2m api?

21.02 has a kmod package for the mmal / video core api, doesn’t say it enables v4l though


You could also try snapshot for a newer kernel.

Thanks for the reply!

Yeah i've tried using mmal instead of v4l2 m2m however i couldn't get the quality i wanted. I'm using a range of cameras (usb, hdmi, ip etc) and therefore i would like to use gstreamer to process the video for me, however it only supports v4l2 m2m and not mmal.

The bcm2835-v4l module is loaded but just not the bcm2835-codec. Doesn't look like newer snapshots have this kernel module either :frowning:

Then unless you’re able to add it yourself I’d suggest you’re out of luck.

Is this a non-free kernel module? If so openwrt may not be able to include it.

I'd rather assume that no one needed it for routing or other common embedded uses so far, therefore no one missed it, nor bothered to add it. If you're finding a 'new' application, you may be the first to notice and end up having to add the packaging/ submit a PR/ patch series.