Long-time readers of CNX Software may remember Bootlin’s crowdfunding campaign launched in 2018 to bring open-source Allwinner VPU drivers to take care of hardware video encoding and decoding in mainline Linux. They managed to raise enough funds (over 30,000 Euros) from small donors and several companies (Olimex, Pine64, Libre Computer, FriendlyELEC, and Orange Pi) to work on open-source VPU drivers for mainline Linux, but only for MPEG2, H264, and H265 decoding for in a range of Allwinner SoCs such as the A20 and H5, but not quite enough to cover the cost of H264 video encoding.
Five years later, Bootlin took it upon themselves to complete the work without backing or support from Allwinner and have now released an open-source Linux-kernel based V4L2 driver to support the H.264 video encoder found in Allwinner V3, V3s, and S3 camera SoCs.
The new driver builds upon earlier work by the company to support the MIPI CSI-2 camera interface and the ISP (Image Signal Processor) in Allwinner V3/V3s/S3 processors both of which were added to mainline Linux in 2021.
Bootlin’s Linux kernel support for H.264 video encoding with the Allwinner V3/V3s/S3 platforms consists of patchsets on top of the mainline Linux Cedrus driver (which already supports decoding) which can be found in the h264-encoding branch on Bootlin’s Linux repo on GitHub, and a dedicated userspace test tool called v4l2-cedrus-enc-test.
The Cedrus driver now uses /dev/video0 for video decoding and /dev/video1 for video encoding in Allwinner V3, V3s, and S3 camera processors. Bootlin explains it’s not quite ready for inclusion in mainline Linux and full support for H.264 encoding due to the following points:
- A new userspace API (uAPI) is needed for exposing stateless encoders in mainline Linux. See the discussion on the linux-media mailing list for details
- Rework of the driver needs to be submitted and merged upstream;
- Rate-control is currently not implemented and only direct QP controls are available
- The new driver only supports the Allwinner V3/V3s/S3 platforms, but other generations use a different, yet rather similar, H.264 encoder units that could also be supported with extra work
- Pre-processing features such as scaling and pixel format conversion are not yet supported
- FFmpeg, GStreamer, and/or other user space libraries would need to be updated to support the stateless encoder uAPI
Bootlin’s announcement has more technical details and the company also welcomes funding from companies that want a more complete open-source Allwinner video encoder driver.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.