Hdmi capture / mpph26xenc latency


I’m working with official ubuntu 20.04.6 LTS from https://wiki.radxa.com/Rock5/downloads

I’m doing HDMI capture, h264/h265 hardware encoding, and rtsp-streaming with gstreamer.

I get help from these posts :

It’s now working, but it needs some improvments :slight_smile:

This command works :
gst-rtsp-server/examples/test-launch “( v4l2src device=/dev/video0 io-mode=dmabuf ! video/x-raw,format=BGR,width=1920,height=1080,framerate=60/1 ! videoconvert ! video/x-raw,width=1920,height=1080,format=NV12,framerate=60/1 ! videorate ! mpph265enc bps=3000000 bps-max=3172000 rc-mode=vbr ! rtph265pay name=pay0 pt=96 )”

If I remove “videorate” it doesn’t work without huge buffer on video player (like 1s) and there is a lot of lost frames (around 15fps only are displayed).
If I add this “videorate” in the pipe, it run without buffering on video player (vlc) and aroung 60fps are displayed

I can let this “videorate”, but I wonder why this could be needed … Any idea ?

My main question is about Latency. I’m getting around 1sec of latency for the sequence hdmi_in_capture => encoding => rtsp/wifi => player

From previous work on this subject, I assume rtsp/wifi and player is about 100 ms.
Do you know a way to calculate hdmi_in_capture and mpph26x encoding latency, and a way to reduce them to their minimum ?

Additionnal question : I could try all this on ubuntu 22.04, where do you get it ? I only see 20.04.6 LTS from https://wiki.radxa.com/Rock5/downloads

Thanks for your help !


1 Like

I use my own custom image (hand-made, not automated, and X11) and i build everything on the board.
I think you are looking for this: (Introduction to rockchip-multimedia ppa for ubuntu jammy)

It’s Wayland but i think you can have X11 as well.
Looks like Wayland is 3x faster for video accel. but not stable as X11.

About the latency, i think there is a parameter/property to suppress latency.

Maybe this can help: