StreamingParameters Struct Reference

Structure containing the options used to stream with the ZED SDK. More...

Functions

 StreamingParameters (STREAMING_CODEC codec=STREAMING_CODEC.H264_BASED, ushort port=3000, uint bitrate=8000, int gopSize=-1, bool adaptativeBitrate=false, ushort chunkSize=32789, int targetFPS=0)
 Default constructor. More...
 

Attributes

STREAMING_CODEC codec
 Encoding used for streaming. More...
 
ushort port
 Port used for streaming. More...
 
uint bitrate
 Defines the streaming bitrate in Kbits/s. More...
 
int gopSize
 GOP size in number of frames. More...
 
bool adaptativeBitrate
 Defines whether the adaptive bitrate is enable. More...
 
ushort chunkSize
 Size of a single chunk. More...
 
int targetFPS
 Framerate for the streaming output. More...
 

Detailed Description

Structure containing the options used to stream with the ZED SDK.

Note
For more info, read about the ZED SDK C++ class it mirrors: StreamingParameters

Constructor and Destructor

◆ StreamingParameters()

StreamingParameters ( STREAMING_CODEC  codec = STREAMING_CODEC.H264_BASED,
ushort  port = 3000,
uint  bitrate = 8000,
int  gopSize = -1,
bool  adaptativeBitrate = false,
ushort  chunkSize = 32789,
int  targetFPS = 0 
)
inline

Default constructor.

All the parameters are set to their default values.

Variables

◆ codec

Encoding used for streaming.

Referenced by StreamingParameters.StreamingParameters().

◆ port

ushort port

Port used for streaming.

Warning
Port must be an even number. Any odd number will be rejected.
Port must be opened.

Referenced by StreamingParameters.StreamingParameters().

◆ bitrate

uint bitrate

Defines the streaming bitrate in Kbits/s.

sl.STREAMING_CODEC sl.RESOLUTION FPS Bitrate (kbps)
H264 HD2K 15 8500
H264 HD1080 30 12500
H264 HD720 60 7000
H265 HD2K 15 7000
H265 HD1080 30 11000
H265 HD720 60 6000

Default: 0 (it will be set to the best value depending on your resolution/FPS)

Note
Available range: [1000 - 60000]

Referenced by StreamingParameters.StreamingParameters().

◆ gopSize

int gopSize

GOP size in number of frames.

Default: -1 (the GOP size will last at maximum 2 seconds, depending on camera FPS)

Note
The GOP size determines the maximum distance between IDR/I-frames. Very high GOP size will result in slightly more efficient compression, especially on static scenes. But latency will increase.
Maximum value: 256

Referenced by StreamingParameters.StreamingParameters().

◆ adaptativeBitrate

bool adaptativeBitrate

Defines whether the adaptive bitrate is enable.

Default: false

Note
Bitrate will be adjusted depending the number of packet dropped during streaming.
If activated, the bitrate can vary between [bitrate/4, bitrate].
Warning
Currently, the adaptive bitrate only works when "sending" device is a NVIDIA Jetson (X1, X2, Xavier, Nano).

Referenced by StreamingParameters.StreamingParameters().

◆ chunkSize

ushort chunkSize

Size of a single chunk.

Default: 16084

Note
Stream buffers are divided into X number of chunks where each chunk is chunkSize bytes long.
You can lower chunkSize value if network generates a lot of packet lost: this will generates more chunk for a single image, but each chunk sent will be lighter to avoid inside-chunk corruption.
Increasing this value can decrease latency.


Note
Available range: [1024 - 65000]

Referenced by StreamingParameters.StreamingParameters().

◆ targetFPS

int targetFPS

Framerate for the streaming output.

Default: 0 (camera framerate will be taken)

Warning
This framerate must be below or equal to the camera framerate.
Allowed framerates are 15, 30, 60 or 100 if possible.
Any other values will be discarded and camera FPS will be taken.

Referenced by StreamingParameters.StreamingParameters().