[PATCH 00/14] media: Add V4L2 H.264 stateless encode and VC8000E support
Michael Nazzareno Trimarchi
michael at amarulasolutions.com
Wed Sep 23 22:30:20 PDT 2026
Hi Paul
On Wed, Sep 23, 2026 at 10:05 PM Paul Kocialkowski <paulk at sys-base.io> wrote:
>
> Hi Michael,
>
> Le Wed 23 Sep 26, 14:10, Michael Nazzareno Trimarchi a écrit :
> > I tested on px30 and achieved working H.264 encoding with some small changes
>
> That is a bit surprising, the Rockchip PX30 should come with a Hantro H1
> (using a modified register layout) while this driver is for the
> Hantro VC8000E, which is a newer generation with very different registers.
>
> Maybe you ended up using CPU-based decoding when testing?
Using
>
> All the best,
>
> Paul
>
> --
> Paul Kocialkowski,
>
> Independent contractor - sys-base - https://www.sys-base.io/
> Free software developer - https://www.paulk.fr/
>
> Expert in multimedia, graphics and embedded hardware support with Linux.
I have added your patch to gstreamer
v4l2codecs: add the stateless H.264 and VP8 encoder elements
Backport of the encoder work from the branch v4l2codecs/h264enc of
https://github.com/paulkocialkowski/gstreamer (commit f59de5779ef1, based
on release 1.26.0) onto the gstreamer1.0-plugins-bad 1.28.5 this build
uses.
Generate the right element and encode stream:
gst-launch-1.0 videotestsrc num-buffers=100 !
video/x-raw,width=720,height=576 ! v4l2slh264enc ! h264parse !
matroskamux ! filesink location=/tmp/t2.mkv
And playback over Wayland.
Solve some problem. I have implemented:
const struct hantro_variant px30_vpu_variant = {
.enc_offset = 0x0,
.enc_fmts = rockchip_vpu_enc_fmts,
.num_enc_fmts = ARRAY_SIZE(rockchip_vpu_enc_fmts),
.dec_offset = 0x400,
.dec_fmts = rockchip_vdpu2_dec_fmts,
.num_dec_fmts = ARRAY_SIZE(rockchip_vdpu2_dec_fmts),
.codec = HANTRO_JPEG_ENCODER | HANTRO_H264_ENCODER |
HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
HANTRO_H264_DECODER,
.codec_ops = px30_vpu_codec_ops,
.irqs = rockchip_vpu2_irqs,
.num_irqs = ARRAY_SIZE(rockchip_vpu2_irqs),
.init = rk3036_vpu_hw_init,
.clk_names = rockchip_vpu_clk_names,
.num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names)
};
I have advertised the:
{
.fourcc = V4L2_PIX_FMT_H264_SLICE,
.codec_mode = HANTRO_MODE_H264_ENC,
.max_depth = 2,
.header_size = H264_ENC_HEADER_SIZE,
.frmsize = {
.min_width = FMT_MIN_WIDTH,
.max_width = FMT_FHD_WIDTH,
.step_width = MB_DIM,
.min_height = FMT_MIN_HEIGHT,
.max_height = FMT_FHD_HEIGHT,
.step_height = MB_DIM,
},
},
Create the rockchip_vpu_hw_h264_enc.c. I need to test this on rk3399
I have a small change only in the common part. Hope that it's a bit clear.
Michael
More information about the linux-arm-kernel
mailing list