Can TX2 support ROI encoding?

Hi all

If I want to use gstreamer to implement ROI Encoding on TX2, How to do it? Does anyone have any experience?

Hi,
We don’t support it in gstreamer. For tegra_multimedia_api, you can implement it via NvBuffer APIs.

NvBufferRect src_rect, dest_rect;
src_rect.top = 0;
src_rect.left = 0;
src_rect.width = ctx->display_width;
src_rect.height = ctx->display_height;
[b]dest_rect.top = roi_x;
dest_rect.left = roi_y;
dest_rect.width = roi_w;
dest_rect.height = roi_h;[/b]

NvBufferTransformParams transform_params;
memset(&transform_params, 0, sizeof(transform_params));
transform_params.transform_flag = NVBUFFER_TRANSFORM_FILTER;
transform_params.transform_flip = NvBufferTransform_None;
transform_params.transform_filter = NvBufferTransform_Filter_Smart;
transform_params.src_rect = src_rect;
transform_params.dst_rect = dest_rect;

You can set rio_x, rio_y, rio_w, rio_h to crop roi from the original frame and then send to NvVideoEncoder.