Rock 3A extremely low performance in GStreamer

Let’s check if you can have 720p in this mode.
what is the output of:

sudo v4l2-ctl --device /dev/video0 --stream-mmap=4 --stream-count=1 --stream-skip=150 --set-fmt-video=width=1280,height=720,pixelformat=NV12

/dev/video0 or any other /dev/videoX possible.

I looked at the driver and seems only these resolutions are available in all modes:

640x480@60fps
2560x1920@?fps
1920x1080@30fps
2592x1944@15fps
1296x972@45fps (in theory)

Maybe one way to get 720p is to resize the grabbed image (1080p) with gstreamer using hw acceleration.

Yes. 1296x972 would be the best alternative. I could work with that.
Even though the datasheet of the sensor says it should be able to do 720p@60.

The output is:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.65 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.83 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.89 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.92 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.94 fps

resize the grabbed image (1080p) with gstreamer using hw acceleration.

Ah, yes, the near-mythical hardware acceleration on these boards…
Would’ve been cool if it were possible for a mere mortal to enable it.

I had a good laugh here.

Not long ago, there was ‘rgaconvert’ property in gstreamer, i think it would do that. It was removed.
I am not a gstreamer advanced user, so i did not care much…

videoscale ! video/x-raw,width=1280,height=720 !

I’ll just crop it in OpenCV.
But the problem still remains that 1296x972@45 doesn’t want to work for some reason.
And to be honest neither does any other resolution.
They all return “Internal data stream error” in GStreamer.

The only thing that works is 2592x1944@15 because that’s the default.
Correction: that resolution works by default but it also can’t be set explicitly in GStreamer.

Whats is your OpenCV version? And distro?

4.6.0 built from source. Distro is Radxa’s Ubuntu Focal. 4.19.193-65-rockchip-gf1279cb7a052.
What’s the importance here though? It’s GStreamer that doesn’t cooperate.

You would get the frames using v4l2, with no gstreamer involved. But you would still need to convert NV12 to BGR i think.

If it was 4.5d i could try something like that, or if you disclose how you built 4.6.0 i could have a try.

I’d just like it to work. Whatever the method.
Other problems are for later.

Btw. any chance libcamera would work here?
I tried compiling it here but there were permission errors during installation.