HDMI input usage

This is more informative than anything:

I spent a good chunk of time trying to get the HDMI input working worth a damn on platforms other than Android and kept running into a brick wall: frame rates of maybe 6fps no matter what I did, etc.

Managed to get it working today, using qv4l2 (“V4L2 Test Bench”):
Open /dev/video0, in wrapped mode; set the streaming method to ‘read()’, everything else can be whatever. It all works. I end up with a passable frame rate for what I’m after - between 30 and 45fps or so. It’s not perfect - I’d really rather it go at 60fps, but I’ll take what I can get for now.

Hi Sarah,

I’m not familiar with the GUI tool you’re using. How are you encoding the frames you capture? What’s the resolution?

The two easiest ways to get a slow video capture pipeline are to 1. not encode the video (and thus generate a huge amount of data that’s hard to write) or 2. encode the video in software rather than hardware (and make the CPU a bottleneck).

Like you I’ve been playing around with video capture on Rockchip SBCs recently, and this gstreamer pipeline works great for me:

gst-launch-1.0 -e v4l2src device=/dev/video0 ! video/x-raw,format=NV16,width=1920,height=1080 ! queue ! mpph265enc ! h265parse ! queue ! mpegtsmux ! filesink location="/storage/hdmihd_$(date +"%Y%m%d_%H%M%S").ts" sync=false

You’ll need to change the video device number to match yours, as well as the video format information after the first !. tsmux is nice because if the pipeline crashes the video is still readable, unlike with avimux.

I’ve only been able to test it briefly at 1080p 60fps on the Rock 5b (I just posted another thread about getting 4k input to work) but it seemed to work well.

If you make progress please update the thread! Sometimes it feels like I’m the first person to ever use the HDMI input on a Rockchip SBC - there are so few threads about this :slight_smile:

1 Like

I’m not actually encoding it, it’s being displayed live. The HDMI input is hooked up to another machine on my desk, providing an extra display to that hardware when needed.

Eventually I’ll take the time to hack together an interface that can send keyboard / mouse to the connected device.

Oh! Of course, displaying it makes sense.

I just verified that I’m able to hit 60 fps @ 1080p and 30 fps @ 4k with pipelines similar to the one I mentioned above, so I would think 60 fps @ 1440p (as mentioned in the other thread) would be doable (with a similar bandwidth to 4k30).

In my various searches I could swear I saw a command that was mirroring the HDMI in to the HDMI out, but I can’t dig it up now.

You’ve probably already been down this road, but if not it might be interesting to try something like this:

gst-launch-1.0 v4l2src device=$device_id ! queue ! video/x-raw,format=RGB ! capssetter replace = true caps="video/x-raw,format=BGR,width=$width,height=$height" ! glimagesink

From this site. I would guess you can set the format to BGR to start with and drop the capssetter. I’d give it a try myself but my board isn’t connected to a monitor at the moment.

Hi Sarah,

I am very interested in this tool that you are showing. Please can you tell me how to obtain it? I have a Rock5 Radxa and have been testing the v4l2src with the gst-launch-1.0 command so far. It would be nice to have this GUI!!!
thanks
Pierre

Hi Nathan,

I have tried your command line for 1080p60 on the Rock5B, but it does not work for me.
I’m getting an “Internal data stream error”. I have a live 1080P60 source connected to the HDMI RX on the RK3588. Only difference is that I need video/format=BGR. Any ideas?
thanks
Pierre

I was able to find the tool, and I installed it. all good. thanks for posting about it!
Pierre

Hello, I have tried the same with qv4l2, but there is not the option of read(), did you guys change something extra ?