GPU powered video crop exists?

Hi everyone,

I’m building a C++ video matrix application using GStreamer. I need to crop up to 16 video streams (4K) from capture cards. To keep performance good, I wanted to do the cropping entirely on the GPU instead of using videocrop, which eats up CPU like crazy (70% cpu usage while gpu usage just 15%).

I asked around and recommended using either:

  1. d3d12compositor with xpos/ypos/width/height on sink pads, but those are for positioning, not cropping.

  2. d3d12convert with crop-left, crop-right, etc., but those properties don’t exist in my GStreamer build.

Running gst-inspect-1.0 d3d12convert doesn’t show any cropping-related properties at all. So I’m stuck with videocrop for now, but at 4K it’s maxing out my CPU.

Has anyone actually gotten GPU cropping working with d3d12convert?

Instead of exposing the crop-XYZ properties, d3d12convert performs cropping based on crop meta attached to input buffers.

If you configure your pipeline like d3d12upload ! videocrop left=WANTED-XPOS ! d3d12convert` or so, videocrop will attach crop meta (instead of actual cropping on CPU), and d3d12convert will perform the actual cropping using crop meta attached by videocrop