Jetson Linux API Reference

32.7.5 Release
V4L2 Video Converter

Detailed Description

NVIDIA V4L2 Video Converter Description and Extensions.

Use the video converter for color space conversion, scaling, and conversion between hardware buffer memory (V4L2_MEMORY_MMAP/V4L2_MEMORY_DMABUF), software buffer memory (V4L2_MEMORY_USERPTR), and other operations such as cropping, flipping/rotating, and temporal noise reduction (TNR). The video converter device node is "/dev/nvhost-vic".

Supported Pixelformats

PIXEL FORMAT PIXEL FORMAT
V4L2_PIX_FMT_YUV444M V4L2_PIX_FMT_YVU422M
V4L2_PIX_FMT_YUV420M V4L2_PIX_FMT_YVU420M
V4L2_PIX_FMT_NV12M V4L2_PIX_FMT_GREY
V4L2_PIX_FMT_YUYV V4L2_PIX_FMT_YVYU
V4L2_PIX_FMT_UYVY V4L2_PIX_FMT_VYUY
V4L2_PIX_FMT_ABGR32 V4L2_PIX_FMT_XBGR32

Supported Pixel Formats for TNR

PIXEL FORMAT PIXEL FORMAT
V4L2_PIX_FMT_YUV420M V4L2_PIX_FMT_NV12M
V4L2_PIX_FMT_UYVY V4L2_PIX_FMT_YUYV

Supported Memory Types

MEMORY OUTPUT PLANE CAPTURE PLANE
V4L2_MEMORY_MMAP Y Y
V4L2_MEMORY_DMABUF Y Y
V4L2_MEMORY_USERPTR Y Y

Supported Controls

Cropping

Video converter supports cropping using VIDIOC_S_SELECTION IOCTL with type V4L2_BUF_TYPE_VIDEO_CAPTURE and target V4L2_SEL_TGT_CROP. This must be set before requesting buffers on either plane.

EOS Handling

The following sequence must be followed for sending EOS and recieving EOS from the converter.

  1. Send EOS to converter by queueing on the output plane a buffer with bytesused = 0 for the 0th plane (v4l2_buffer.m.planes[0].bytesused = 0).
  2. Dequeues buffers on the capture plane until it gets a buffer with bytesused = 0 for the 0th plane.
Note
Currently, V4L2 plugins do not support odd resolution.

Data Structures

struct  v4l2_ctrl_video_displaydata_
 
struct  _v4l2_ctrl_video_hdrmasteringdisplaydata
 HDR Metadata. More...
 
struct  _v4l2_ctrl_video_device_poll
 Poll device. More...
 

Macros

#define V4L2_CID_VIDEO_CONVERT_OUTPUT_PLANE_LAYOUT   (V4L2_CID_MPEG_BASE+523)
 Defines the Control ID to set converter output plane buffer layout. More...
 
#define V4L2_CID_VIDEO_CONVERT_CAPTURE_PLANE_LAYOUT   (V4L2_CID_MPEG_BASE+524)
 Defines the Control ID to set converter capture plane buffer layout. More...
 
#define V4L2_CID_VIDEO_CONVERT_FLIP_METHOD   (V4L2_CID_MPEG_BASE+525)
 Defines the Control ID to set the converter flip/rotation method. More...
 
#define V4L2_CID_VIDEO_CONVERT_INTERPOLATION_METHOD   (V4L2_CID_MPEG_BASE+526)
 Defines the Control ID to set the converter interpolation method. More...
 
#define V4L2_CID_VIDEO_CONVERT_TNR_ALGORITHM   (V4L2_CID_MPEG_BASE+527)
 Defines the Control ID to set the converter Temporal Noise Reduction (TNR) algorithm. More...
 

Typedefs

typedef struct v4l2_ctrl_video_displaydata_ v4l2_ctrl_video_displaydata
 
typedef struct _v4l2_ctrl_video_hdrmasteringdisplaydata v4l2_ctrl_video_hdrmasteringdisplaydata
 HDR Metadata. More...
 
typedef struct _v4l2_ctrl_video_device_poll v4l2_ctrl_video_device_poll
 Poll device. More...
 

Enumerations

enum  v4l2_nv_buffer_layout {
  V4L2_NV_BUFFER_LAYOUT_PITCH = 0,
  V4L2_NV_BUFFER_LAYOUT_BLOCKLINEAR = 1
}
 Enum specifying types of buffer layouts. More...
 
enum  v4l2_flip_method {
  V4L2_FLIP_METHOD_IDENTITY = 0,
  V4L2_FLIP_METHOD_90L = 1,
  V4L2_FLIP_METHOD_180 = 2,
  V4L2_FLIP_METHOD_90R = 3,
  V4L2_FLIP_METHOD_HORIZ = 4,
  V4L2_FLIP_METHOD_INVTRANS = 5,
  V4L2_FLIP_METHOD_VERT = 6,
  V4L2_FLIP_METHOD_TRANS = 7
}
 Specifies the types of rotation/flip algorithms. More...
 
enum  v4l2_interpolation_method {
  V4L2_INTERPOLATION_NEAREST = 1,
  V4L2_INTERPOLATION_BILINEAR = 2,
  V4L2_INTERPOLATION_5_TAP = 3,
  V4L2_INTERPOLATION_10_TAP = 4,
  V4L2_INTERPOLATION_SMART = 5,
  V4L2_INTERPOLATION_NICEST = 6
}
 Specifies the types of interpolation methods. More...
 
enum  v4l2_tnr_algorithm {
  V4L2_TNR_ALGO_ORIGINAL = 0,
  V4L2_TNR_ALGO_OUTDOOR_LOW_LIGHT = 1,
  V4L2_TNR_ALGO_OUTDOOR_MEDIUM_LIGHT = 2,
  V4L2_TNR_ALGO_OUTDOOR_HIGH_LIGHT = 3,
  V4L2_TNR_ALGO_INDOOR_LOW_LIGHT = 4,
  V4L2_TNR_ALGO_INDOOR_MEDIUM_LIGHT = 5,
  V4L2_TNR_ALGO_INDOOR_HIGH_LIGHT = 6
}
 Specifies the types of TNR algorithms. More...
 
enum  v4l2_yuv_rescale_method {
  V4L2_YUV_RESCALE_NONE = 0,
  V4L2_YUV_RESCALE_STD_TO_EXT = 1,
  V4L2_YUV_RESCALE_EXT_TO_STD = 2
}
 Specifies the types of YUV rescale methods. More...
 

Macro Definition Documentation

◆ V4L2_CID_VIDEO_CONVERT_CAPTURE_PLANE_LAYOUT

#define V4L2_CID_VIDEO_CONVERT_CAPTURE_PLANE_LAYOUT   (V4L2_CID_MPEG_BASE+524)

Defines the Control ID to set converter capture plane buffer layout.

A value of type v4l2_nv_buffer_layout must be supplied with this control.

Attention
This control must be set before requesting buffers on the capture plane.

Definition at line 677 of file v4l2_nv_extensions.h.

◆ V4L2_CID_VIDEO_CONVERT_FLIP_METHOD

#define V4L2_CID_VIDEO_CONVERT_FLIP_METHOD   (V4L2_CID_MPEG_BASE+525)

Defines the Control ID to set the converter flip/rotation method.

A value of type v4l2_flip_method must be supplied with this control.

Attention
This control must be set before requesting buffers on either plane.

Definition at line 686 of file v4l2_nv_extensions.h.

◆ V4L2_CID_VIDEO_CONVERT_INTERPOLATION_METHOD

#define V4L2_CID_VIDEO_CONVERT_INTERPOLATION_METHOD   (V4L2_CID_MPEG_BASE+526)

Defines the Control ID to set the converter interpolation method.

A value of type v4l2_interpolation_method must be supplied with this control.

Attention
This control must be set before requesting buffers on either plane.

Definition at line 695 of file v4l2_nv_extensions.h.

◆ V4L2_CID_VIDEO_CONVERT_OUTPUT_PLANE_LAYOUT

#define V4L2_CID_VIDEO_CONVERT_OUTPUT_PLANE_LAYOUT   (V4L2_CID_MPEG_BASE+523)

Defines the Control ID to set converter output plane buffer layout.

A value of type v4l2_nv_buffer_layout must be supplied with this control.

Attention
This control must be set before requesting buffers on the output plane.

Definition at line 668 of file v4l2_nv_extensions.h.

◆ V4L2_CID_VIDEO_CONVERT_TNR_ALGORITHM

#define V4L2_CID_VIDEO_CONVERT_TNR_ALGORITHM   (V4L2_CID_MPEG_BASE+527)

Defines the Control ID to set the converter Temporal Noise Reduction (TNR) algorithm.

A value of type v4l2_tnr_algorithm must be supplied with this control.

Attention
This control must be set before requesting buffers on either plane.
TNR algorithms are not supported with YUV422 and YUV444 capture plane formats.

Definition at line 706 of file v4l2_nv_extensions.h.

Typedef Documentation

◆ v4l2_ctrl_video_device_poll

◆ v4l2_ctrl_video_displaydata

◆ v4l2_ctrl_video_hdrmasteringdisplaydata

Enumeration Type Documentation

◆ v4l2_flip_method

Specifies the types of rotation/flip algorithms.

Enumerator
V4L2_FLIP_METHOD_IDENTITY 

Identity (no rotation).

V4L2_FLIP_METHOD_90L 

Rotate counter-clockwise 90 degrees.

V4L2_FLIP_METHOD_180 

Rotate 180 degrees.

V4L2_FLIP_METHOD_90R 

Rotate clockwise 90 degrees.

V4L2_FLIP_METHOD_HORIZ 

Flip horizontally.

V4L2_FLIP_METHOD_INVTRANS 

Flip across upper right/lower left diagonal.

V4L2_FLIP_METHOD_VERT 

Flip vertically.

V4L2_FLIP_METHOD_TRANS 

Flip across upper left/lower right diagonal.

Definition at line 2380 of file v4l2_nv_extensions.h.

◆ v4l2_interpolation_method

Specifies the types of interpolation methods.

Enumerator
V4L2_INTERPOLATION_NEAREST 

Nearest interpolation method.

V4L2_INTERPOLATION_BILINEAR 

Bi-Linear interpolation method.

V4L2_INTERPOLATION_5_TAP 

5-Tap interpolation method

V4L2_INTERPOLATION_10_TAP 

10-Tap interpolation method

V4L2_INTERPOLATION_SMART 

Smart interpolation method.

V4L2_INTERPOLATION_NICEST 

Nicest interpolation method.

Definition at line 2394 of file v4l2_nv_extensions.h.

◆ v4l2_nv_buffer_layout

Enum specifying types of buffer layouts.

Enumerator
V4L2_NV_BUFFER_LAYOUT_PITCH 

Pitch Linear Layout.

V4L2_NV_BUFFER_LAYOUT_BLOCKLINEAR 

Block Linear Layout.

Definition at line 2372 of file v4l2_nv_extensions.h.

◆ v4l2_tnr_algorithm

Specifies the types of TNR algorithms.

Enumerator
V4L2_TNR_ALGO_ORIGINAL 

Default TNR algorithm.

V4L2_TNR_ALGO_OUTDOOR_LOW_LIGHT 

Outdoor Low Light TNR algorithm.

V4L2_TNR_ALGO_OUTDOOR_MEDIUM_LIGHT 

Outdoor Medium Light TNR algorithm.

V4L2_TNR_ALGO_OUTDOOR_HIGH_LIGHT 

Outdoor High Light TNR algorithm.

V4L2_TNR_ALGO_INDOOR_LOW_LIGHT 

Indoor Low Light TNR algorithm.

V4L2_TNR_ALGO_INDOOR_MEDIUM_LIGHT 

Indoor Medium Light TNR algorithm.

V4L2_TNR_ALGO_INDOOR_HIGH_LIGHT 

Indoor High Light TNR algorithm.

Definition at line 2406 of file v4l2_nv_extensions.h.

◆ v4l2_yuv_rescale_method

Specifies the types of YUV rescale methods.

Enumerator
V4L2_YUV_RESCALE_NONE 

Disable.

Standard(limited range [16 235]) to extension(full range [0 255])

V4L2_YUV_RESCALE_STD_TO_EXT 

Extension(full range [0 255] to standard(limited range [16 235])

V4L2_YUV_RESCALE_EXT_TO_STD 

Definition at line 2419 of file v4l2_nv_extensions.h.