DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Image Capture
SW Release Applicability: This tutorial is applicable to modules in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

This tutorial demonstrates how to utilize the FrameCapture module to capture images from a window rendered on screen.

The FrameCapture module is accessed through a handle:

Initializing the FrameCapture Module

The dwFrameCaptureHandle_t handle initializes the FrameCapture module with the following parameters, once they are declared and assigned.

dwFrameCaptureParams frameParams{};
std::string params = "type=disk";
params += ",format=h264";
params += ",bitrate=8000000";
params += ",framerate=30";
params += ",file=video.h264";
frameParams.params.parameters = params.c_str();
frameParams.width = imageWidth;
frameParams.height = imageHeight;
frameParams.serializationType = DW_IMAGE_GL;

For a complete description of all parameters, please refer to dwFrameCaptureParams.

For simplicity, steps to render this window are left out of this tutorial. Please refer to Rendering Engine Sample for more information.

Capturing the Window's Content

To capture the content inside the window:

dwRect roiCapture = {0, 0, WINDOW_WIDTH, WINDOW_HEIGHT};
const dwImageGL* imgGL = nullptr;
dwFrameCapture_screenCapture(&imgGL, roiCapture,frameCapture);

Releasing the Handle

To release the handle:


To see a full demonstration of this workflow, please refer to Image Capture Sample.