Hello,
Currently Raspberry Pi 4 comes with GStreamer 1.22.0 which is too old. As such, I’m in a situation to build and try out the latest GStreamer 1.24.12 with v4l2 hardware accelerated plugins.
Does anyone know how to enable hardware accelerated plugins to be built using mono repo and meson? Or point me in the right direction?
I believe I have to download and point the build to GitHub - raspberrypi/firmware: This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware. - however, I no longer see firmware/opt/vc folder which would have include and lib files that would be picked up by meson 
Thanks a bunch in advanced!
It is my understanding that the Raspbery Pi 4 does not use the proprietary Broadcom libraries anymore and uses a Mesa GPU driver and V4L2 drivers for hardware encoding/decoding.
As such, as long as you have the relevant v4l2 headers you would be able to use hardware encoding/decoding.
That appears to be true, it took 68 minutes to build GStreamer 1.24.12 (that’s fast), however I only see h264 support and h265 support seems to be missing, please let me know if you have any further ideas thanks:
gst-inspect-1.0 | grep -i v4l2
video4linux2: v4l2convert: V4L2 Video Converter
video4linux2: v4l2deviceprovider (GstDeviceProviderFactory)
video4linux2: v4l2h264dec: V4L2 H264 Decoder
video4linux2: v4l2h264enc: V4L2 H.264 Encoder
video4linux2: v4l2jpegdec: V4L2 JPEG Decoder
video4linux2: v4l2jpegenc: V4L2 JPEG Encoder
video4linux2: v4l2radio: Radio (video4linux2) Tuner
video4linux2: v4l2sink: Video (video4linux2) Sink
video4linux2: v4l2src: Video (video4linux2) Source
video4linux2: v4l2video18convert: V4L2 Video Converter
video4linux2: v4l2video31jpegenc: V4L2 JPEG Encoder
The Rasperry Pi 4 has two seperate codec. The first one, which is the original RPi codec, runs a firmware on the vcore and offers what we call a “stateful” decoder interface. These codec have existing in Linux since 2011, and are implemented by the libgstvideo4linux2 plugin. The 4 also includes a second converter and a second jpeg encoder (as you can see with v4l2video18convert
and v4l2video31jpegenc
. H.264 is the only other hardware encoder.
The HEVC decoder is of another type, the stateless type. It is directly connected to the SoC and controlled by a Linux driver. The decoder will be supported by libgstv4l2codecs plugin in 1.26 (though GL or wayland but not through the software converter). You can also give it a try with the main branch of GStreamer.