GStreamer plugin source code and ROI Support on Encoder


We have a customer interested on ROI support for video encoding. Specifically they want to specify a ROI to let the encoder know that some parts of the image could be compressed with higher quantization.

Looking for options I found that the V4L2 API for the encoder seems to have ROI Support:

but when checking the properties of the nvv4l2h264enc element I was not able to find a property to select the ROI or the parameters that the codec should use for it.

  1. Can we get access to the code for the GStreamer elements based in V4L2 extensions? In order to extend it?
  2. Have NVIDIA validated that the ROI support works on the codec?

Please note that I don’t want to crop the ROI, I just want the codec using a different quantization on the ROI.


The parameters have to be configured frame by frame, so we have it enabled in tegra_multimedia_api. nvv4l2h264enc is based on open source gst-v4l2 package and we have to check if it can be implemented. It is a feature request.

So for more information, you need to control ROI frame by frame? Or a fixed setting configured in the beginning and applied to all frames?

Hi DaneLLL,

Glad to hear that the codec supports the feature. I am checking with the customer to see if they are planning on changing the ROI dynamically (per frame for instance) or if the ROI would be a static parameter.

In any case, in GStreamer you could implement this as a dynamic parameter, basically let the element receive the ROI as a property. If nobody sets a parameter the ROI is the whole frame. Would that work?

It sounds like source code for the plugins is not available. If you give us access we can implement the feature and push it back. Just thinking on options. Another option is to get a modified binary with the feature implemented? Thanks!

nvv4l2h264enc and nvv4l2h265enc are open source. Please check gst-nvvideo4linux2_src.tbz2 in

We will evaluate the feature request.

Hi DaneLLL,

Thanks for sharing the link, we will review the code as well.


Did you manage to implement this feature and push it upstream? Would be interested in testing it out.


Hi @bobsaccamano,

Our customer changed the priority and we didn’t work on the ROI support anymore. However, now that the code is available it should be easy to extend it to support it. I recommend you to take a look to the function called:

int NvVideoEncoder::setROIParams in