Hardware h264 video encoding.
#1
I've been searching and searching and I'm finding various info about people saying h264 hardware encoding is implemented. I even found some github code for hantro h1 encoder which supposedly rk3566 has, but there is no straightforward confirmation whether this works or not.

I really don't care about the OS. I would prefer Linux, but android is fine too. Can someone please confirm or deny h264 encoding works on this hw? If no OS driver exists then is there a closed source driver?
  Reply
#2
Hardware video encoding for H.264 currently only works using the BSP (downstream) kernel, with the rockchip MPP framework. The mainline Linux kernel, which many (all?) current images use, does not have hardware encoding capabilities for H.264 at this time (only very poor JPEG).

Furthermore, ffmpeg mainline does not appear to have encoding capabilities for the MPP API at this moment.

I am currently not aware of which tools can encode video through MPP, but surely they are out there somewhere bitrotting in a vendor repo. The terms you're searching for are rockchip mpp or rkmpp.

It'd be great to have a v4l2-based encoder for either hantro h.264, or even better, rkvenc, (yes the SoC has two H.264 encoders) in mainline Linux, but sadly nobody has been hired to do that work at the moment, and it'd be a lot of work so not something a volunteer can do on weekends.

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply
#3
I haven't checked, but you can do it yourself. There is a version of Armbian legacy that uses BSP core, perhaps coding can work there. It may be necessary to add MPP components or libraries, but the kernel must have the necessary modules\functions for this.

https://disk.yandex.ru/d/QgHj3dnPeNTECg
  Reply
#4
(07-13-2022, 02:20 PM)CounterPillow Wrote: Hardware video encoding for H.264 currently only works using the BSP (downstream) kernel, with the rockchip MPP framework. The mainline Linux kernel, which many (all?) current images use, does not have hardware encoding capabilities for H.264 at this time (only very poor JPEG).

Furthermore, ffmpeg mainline does not appear to have encoding capabilities for the MPP API at this moment.

I am currently not aware of which tools can encode video through MPP, but surely they are out there somewhere bitrotting in a vendor repo. The terms you're searching for are rockchip mpp or rkmpp.

It'd be great to have a v4l2-based encoder for either hantro h.264, or even better, rkvenc, (yes the SoC has two H.264 encoders) in mainline Linux, but sadly nobody has been hired to do that work at the moment, and it'd be a lot of work so not something a volunteer can do on weekends.

Thank you for the reply.Of course I would preferc'' Linux BSP would be good if I can get it working well. My preferred tool is gstreamer, but if necessary perhaps I could make a simple C tool instead.

Interesting about two encoders. Does this mean that if I fail to get sufficiently good quality from one I can try another or does the MPP API support only one of them?

I've finally managed to download the monster 36GB file Linux BSP comes in and I'm downloading the Android one to compare with.

Unfortunately, I haven't found any guide or documentation on how to make a quick dev/testing OS image and I haven't found a precompiled example included. Is there perhaps some guide/tutorial online(for Linux and Android) or if it is very simple could someone let me know here how to build one, please?

There are documents with reference info for individual features including MPP, but I haven't located an overall "BSP Usage Guide"

(07-14-2022, 12:12 AM)balbes150 Wrote: I haven't checked, but you can do it yourself. There is a version of Armbian legacy that uses BSP core, perhaps coding can work there. It may be necessary to add MPP components or libraries, but the kernel must have the necessary modules\functions for this.

https://disk.yandex.ru/d/QgHj3dnPeNTECg

Thank you. For now my goal is to get video encoding (from the camera) using any software (Linux BSP, Android, anything) to check what quality video it produces at what latency, but when I progress beyond basic testing this will be very useful.


Encoding works fine for me now. Anyone wanting to do this I suggest to follow the custom bsp build process described in another post by user Shaggy013.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Lakka OS for video game emulation FOSSagent0 0 1,340 05-06-2022, 12:05 PM
Last Post: FOSSagent0

Forum Jump:


Users browsing this thread: 1 Guest(s)