April 27, 20242 yr I've compiled mainline kernel 6.6 which runs well on my OrangePi/RK3399. The only problem left is getting H.264 decoding working. Unfortunately, when I query /dev/video1 which is the node created by the hantro-vpu driver, only MPEG2 and VP8 are shown as supported codecs for decoding. No H.264, even though I've read many places that the mainline hantro driver supports H.264. Has anyone else had this problem? Is there something else I need to do to get this working?
April 27, 20242 yr Just a pure guess but have you tried a more recent userspace like noble or trixie? Maybe the kernel isn't the issue but the software accessing it.
April 27, 20242 yr Author I'm using vl42-ctl to query the kernel directly through ioctls, so these decoders should show. The only other thing is no more than 2 nodes are created: /dev/video0 and /dev/video1. Could it be a udev thing?
April 27, 20242 yr Author Turns out it was a device tree problem. After updating the device tree, I can see the nodes set up by the mainline Rockchip hantro-vpu and rkvdec modules: /dev/video0: rockchip-rga /dev/video1: hantro-vpu (encoder) /dev/video2: hantro-vpu (decoder) /dev/video3: rkvdec
April 27, 20242 yr 4 hours ago, McTurbo said: hantro-vpu driver, only MPEG2 and VP8 are shown as supported codecs for decoding. No H.264 Since userspace cannot sensibly select between two decoder instances of the same type, the H.264 hanto decoder is usually disabled for the rk3399 and the H.264 rkvdec is preferred. videoX-infos-nanopc-t4.log
April 27, 20242 yr Author 1 hour ago, usual user said: Since userspace cannot sensibly select between two decoder instances of the same type, the H.264 hanto decoder is usually disabled for the rk3399 and the H.264 rkvdec is preferred. Thanks. Just to be clear, that's the rkvdec from staging drivers, right? It overrides hantro for H.264? Oh and I'm assuming the reason hantro H.264 is disabled is rkvdec offers better performance. Is that right? Edited April 27, 20242 yr by McTurbo
May 1, 20242 yr On 4/27/2024 at 8:44 AM, McTurbo said: Thanks. Just to be clear, that's the rkvdec from staging drivers, right? It overrides hantro for H.264? Oh and I'm assuming the reason hantro H.264 is disabled is rkvdec offers better performance. Is that right? rkvdec does not technically "override" hantro h.264: hantro and rkvdec are two totally different devices and both are exposed by v4l2 framework to userspace. It's up to the user application to choose the preferred device. Ffmpeg, which is perhaps the most common user application around, has no way to choose the v4l2 device for h.264. The workaround to force ffmpeg to use rkvdec (yes, because it is more performant) was to avoid declaring hantro as capable of h.264, sto the only left h.264 decoder is rkvdec. edit: and yes, rkvdec is in the kernel staging directory, plus armbian has a patch to enable h.265 decoding too
May 9, 20242 yr Author On 5/1/2024 at 5:34 AM, jock said: avoid declaring hantro as capable of h.264, sto the only left h.264 decoder is rkvdec. Where is this done? Is this done in the source for the hantro module? If I wanted to experiment by enabling the hantro H.264 decoder, how would I do that? On 5/1/2024 at 5:34 AM, jock said: armbian has a patch to enable h.265 decoding too Is this the same patch used by LibreELEC? I have H.264 decoding working, so I definitely want to try this.
May 10, 20242 yr 17 hours ago, McTurbo said: Where is this done? Is this done in the source for the hantro module? If I wanted to experiment by enabling the hantro H.264 decoder, how would I do that? Definitely, if you look at the kernel source code you can enable the codec 17 hours ago, McTurbo said: Is this the same patch used by LibreELEC? I have H.264 decoding working, so I definitely want to try this. Yes, it is. I think it is in the kernel mailing list, so it is something that is already floating around and eventually will be merged.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.