V4L2 multiplanar support && Rockchip MPP encoder & RGA (for RK3588: Native 4k60 HDMI Input)

hallo1

New Member
Recently I have got a Rock 5B SBC for ~120$ which is built on the RK3588, The most powerful ARM SoC from Rockchip.

What amazed me most is that the RK3588 have a native(built-in) HDMI Input capture component which support HDMI 2.0, 4K 60hz @ RGB888 format as well as H.264& H.265 encoder capable for 8K 30hz encoding.
Along with 8 core CPU, LPDDR4x memory, 1Gbps ethernet, It is the perfect solution for a streaming machine!

gstreamer is working fine. If you have the same board you can try:
Bash:
gst-launch-1.0 -e v4l2src device=/dev/video0 ! 'video/x-raw,format=NV12,width=3840,height=2160' ! tee name=t t. ! mpph265enc bps=20000000 bps-max=40000000 rc-mode=vbr ! h265parse ! mp4mux name=mux ! filesink location=4k60hdmiin.mp4 alsasrc device=default ! opusenc ! mux. t. ! queue leaky=1 ! autovideosink sync=false
to record & view the stream in 4K60&NV12(YUV 4:2:0) simultaneously.
The video recorded is great, no obvious frame drop noticed and the result is definitely 4K without compression, upscaling/downscaling etc.
Audio works as well.
Lantency from the v4l2src to autovideosink (without the encoder) is ~80ms. Also great.
The CPU usage of just about 10% indicates that it is hardware acceleated.

But the OBS nearly can't work at all because:
- In the Rockchip vendor kernel, the HDMI Input is done through V4L2 device but it is using multi-planar format which OBS don't support. As a result, If you tried to use the input it just return a black screen and show "Inappropriate ioctl for device" error in terminal. gstreamer workaround
- Rockchip MPP (rkmpp) encoder is not supported in ffmpeg at all. also gstreamer workaround
- The performance is extremely low no matter if I turned on or off the recording. That means, ~80% CPU usage with 1080p 30hz!
From the internal profiler it seems that the render_convert_texture function consumed most CPU time.
 

myxed

New Member
I agree that the specs look amazing. Have one on order. However, can you confirm that HDMI input is limited to 8 bit? What I read was that it supports HDMI 2.0, that should encompass something like 422 10 bit. Do you know if it is actually limited in this way? The encoder *seems* to support Main10 which makes sense if the inputs are > 8 bit
 
Top