Twitch SDK (Internal)
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ttv::broadcast::VideoParams Struct Reference

#include <broadcasttypes.h>

Public Member Functions

 VideoParams ()
 

Static Public Member Functions

static TTV_ErrorCode ConfigureForBandwidth (uint32_t expectedKbps, uint32_t framesPerSecond, float bitsPerPixel, float aspectRatio, VideoParams &result)
 
static TTV_ErrorCode ConfigureForResolution (uint32_t width, uint32_t height, uint32_t framesPerSecond, float bitsPerPixel, VideoParams &result)
 

Public Attributes

uint32_t outputWidth
 
uint32_t outputHeight
 
uint32_t targetFramesPerSecond
 
uint32_t initialKbps
 
uint32_t minimumKbps
 
uint32_t maximumKbps
 
EncodingCpuUsage encodingCpuUsage
 
bool automaticBitRateAdjustmentEnabled
 

Detailed Description

Video parameters that are set at the beginning of a broadcast session.

Constructor & Destructor Documentation

◆ VideoParams()

ttv::broadcast::VideoParams::VideoParams ( )

Member Function Documentation

◆ ConfigureForBandwidth()

static TTV_ErrorCode ttv::broadcast::VideoParams::ConfigureForBandwidth ( uint32_t  expectedKbps,
uint32_t  framesPerSecond,
float  bitsPerPixel,
float  aspectRatio,
VideoParams result 
)
static

Configures the video parameters so that a broadcast stays within the given maxKbps. The resolution of the broadcast will be computed automatically based on given parameters.

Parameters
[in]expectedKbpsThe expeected bit rate of the connection in 1000s of bits per second.
[in]framesPerSecondThe number of frames per second that will be submitted by the capturer and output in the stream.
[in]bitsPerPixelThe number of bits to use per pixel. A good recommended value is 0.1.
[in]aspectRatioThe desired aspect ratio of the calculated resolution.
Returns
  • TTV_EC_SUCCESS - The configuration was successful.
  • TTV_EC_BROADCAST_INVALID_BITRATE - The bit rate was not within the required range for the Twitch backend.
  • TTV_EC_BROADCAST_INVALID_FPS - The frames per second value was not within the required range for the Twitch backend.
  • TTV_EC_INVALID_ARG - The aspect ratio or bits per pixel were not valid inputs.

◆ ConfigureForResolution()

static TTV_ErrorCode ttv::broadcast::VideoParams::ConfigureForResolution ( uint32_t  width,
uint32_t  height,
uint32_t  framesPerSecond,
float  bitsPerPixel,
VideoParams result 
)
static

Configures the broadcast settings directly allowing a specific resolution and framerate to be used. Please note that this method may result in a broadcast that tries to send more data than a user's connection can support. Use SetVideoParams() along with ingest testing to ensure the best stream quality available.

Parameters
[in]widthThe desired width of the stream in pixels.
[in]heightThe desired height of the stream in pixels.
[in]framesPerSecondThe number of frames per second that will be submitted by the capturer and output in the stream.
[in]bitsPerPixelThe number of bits to use per pixel. A good recommended value is 0.1.
Returns
  • TTV_EC_SUCCESS - The configuration was successful.
  • TTV_EC_BROADCAST_INVALID_RESOLUTION - The resolution was not within the required range for the Twitch backend.
  • TTV_EC_BROADCAST_INVALID_FPS - The frames per second value was not within the required range for the Twitch backend.

Member Data Documentation

◆ automaticBitRateAdjustmentEnabled

bool ttv::broadcast::VideoParams::automaticBitRateAdjustmentEnabled

Whether or not to adjust bit rate dynamically based on available bandwidth.

◆ encodingCpuUsage

EncodingCpuUsage ttv::broadcast::VideoParams::encodingCpuUsage

The desired CPU usage level for video encoding. This property may not have any effect on some encoders and platforms.

◆ initialKbps

uint32_t ttv::broadcast::VideoParams::initialKbps

The starting bit rate in 1000s of bits per second. If automatic bit rate adjustment is disabled then this will be the constant bit rate used by the video encoder.

◆ maximumKbps

uint32_t ttv::broadcast::VideoParams::maximumKbps

When automatic bit rate adjustment is enabled, this is maximum bit rate in 1000s of bits per second.

◆ minimumKbps

uint32_t ttv::broadcast::VideoParams::minimumKbps

When automatic bit rate adjustment is enabled, this is minimum bit rate in 1000s of bits per second.

◆ outputHeight

uint32_t ttv::broadcast::VideoParams::outputHeight

The height of the output video stream in pixels. The IVideoCapturer should produce frames with this exact height for best quality.

◆ outputWidth

uint32_t ttv::broadcast::VideoParams::outputWidth

The width of the output video stream in pixels. The IVideoCapturer should produce frames with this exact width for best quality.

◆ targetFramesPerSecond

uint32_t ttv::broadcast::VideoParams::targetFramesPerSecond

The number of frames per second that will be submitted by the capturer and output in the stream.


The documentation for this struct was generated from the following file: