Sunshine master
Self-hosted game stream host for Moonlight.
nvenc Namespace Reference

Standalone NVENC encoder. More...

Classes

class  nvenc_base
 Abstract platform-agnostic base of standalone NVENC encoder. Derived classes perform platform-specific operations. More...
 
struct  nvenc_colorspace_t
 YUV colorspace and color range. More...
 
struct  nvenc_config
 NVENC encoder configuration. More...
 
class  nvenc_d3d11
 Abstract Direct3D11 NVENC encoder. Encapsulates common code used by native and interop implementations. More...
 
class  nvenc_d3d11_native
 Native Direct3D11 NVENC encoder. More...
 
class  nvenc_d3d11_on_cuda
 Interop Direct3D11 on CUDA NVENC encoder. Input surface is Direct3D11, encoding is performed by CUDA. More...
 
struct  nvenc_encoded_frame
 Encoded NVENC output frame and metadata needed by the packetizer. More...
 

Typedefs

using ID3D11DevicePtr = ID3D11Device *
 COM smart pointer for ID3D11Device.
 
using ID3D11Texture2DPtr = ID3D11Texture2D *
 COM smart pointer for ID3D11Texture2D.
 
using IDXGIAdapterPtr = IDXGIAdapter *
 COM smart pointer for IDXGIAdapter.
 
using IDXGIDevicePtr = IDXGIDevice *
 COM smart pointer for IDXGIDevice.
 

Enumerations

enum class  nvenc_split_frame_encoding { disabled , driver_decides , force_enabled }
 Enumerates supported nVENC split frame encoding options. More...
 
enum class  nvenc_two_pass { disabled , quarter_resolution , full_resolution }
 Enumerates supported nVENC two pass options. More...
 

Functions

DXGI_FORMAT dxgi_format_from_nvenc_format (NV_ENC_BUFFER_FORMAT format)
 Convert an NVENC buffer format to the matching DXGI format.
 
nvenc_colorspace_t nvenc_colorspace_from_sunshine_colorspace (const video::sunshine_colorspace_t &sunshine_colorspace)
 Convert Sunshine colorspace metadata to NVENC VUI metadata.
 
NV_ENC_BUFFER_FORMAT nvenc_format_from_sunshine_format (platf::pix_fmt_e format)
 Convert a Sunshine pixel format to the matching NVENC buffer format.
 

Detailed Description

Standalone NVENC encoder.

Enumeration Type Documentation

◆ nvenc_split_frame_encoding

Enumerates supported nVENC split frame encoding options.

Enumerator
disabled 

Disable.

driver_decides 

Let driver decide.

force_enabled 

Force-enable.

◆ nvenc_two_pass

enum class nvenc::nvenc_two_pass
strong

Enumerates supported nVENC two pass options.

Enumerator
disabled 

Single pass, the fastest and no extra vram.

quarter_resolution 

Larger motion vectors being caught, faster and uses less extra vram.

full_resolution 

Better overall statistics, slower and uses more extra vram.

Function Documentation

◆ dxgi_format_from_nvenc_format()

DXGI_FORMAT nvenc::dxgi_format_from_nvenc_format ( NV_ENC_BUFFER_FORMAT format)

Convert an NVENC buffer format to the matching DXGI format.

Parameters
formatPixel, audio, or protocol format being converted.
Returns
DXGI texture format that matches the NVENC buffer format.

◆ nvenc_colorspace_from_sunshine_colorspace()

nvenc_colorspace_t nvenc::nvenc_colorspace_from_sunshine_colorspace ( const video::sunshine_colorspace_t & sunshine_colorspace)

Convert Sunshine colorspace metadata to NVENC VUI metadata.

Parameters
sunshine_colorspaceSunshine colorspace.
Returns
NVENC colorspace and VUI fields for the Sunshine metadata.

◆ nvenc_format_from_sunshine_format()

NV_ENC_BUFFER_FORMAT nvenc::nvenc_format_from_sunshine_format ( platf::pix_fmt_e format)

Convert a Sunshine pixel format to the matching NVENC buffer format.

Parameters
formatPixel, audio, or protocol format being converted.
Returns
NVENC buffer format compatible with the Sunshine pixel format.