StreamingParameters Class Reference

Sets the streaming parameters. More...

Functions

def __cinit__ (self, codec=STREAMING_CODEC.H265, port=30000, bitrate=8000, gop_size=-1, adaptative_bitrate=False, chunk_size=32768, target_framerate=0)
 Constructor. More...
 
def chunk_size (self)
 Defines a single chunk size. More...
 
def codec (self)
 Defines the codec used for streaming. More...
 
def port (self)
 Defines the port the data will be streamed on. More...
 
def bitrate (self)
 Defines the streaming bitrate in Kbits/s.
 
def adaptative_bitrate (self)
 Enable/Disable adaptive bitrate. More...
 
def gop_size (self)
 Defines the gop size in frame unit. More...
 
def target_framerate (self)
 defines the target framerate for the streaming output. More...
 

Detailed Description

Sets the streaming parameters.

The default constructor sets all parameters to their default settings.

Note
Parameters can be user adjusted.

Functions

◆ __cinit__()

def __cinit__ (   self,
  codec = STREAMING_CODEC.H265,
  port = 30000,
  bitrate = 8000,
  gop_size = -1,
  adaptative_bitrate = False,
  chunk_size = 32768,
  target_framerate = 0 
)

Constructor.

Parameters
codec: the chosen codec
port: the chosen port
bitrate: the chosen bitrate
gop_size: the chosen gop_size
adaptative_bitrate: activtates adaptative_bitrate
chunk_size: the chosen chunk_size
target_framerate: the chosen target_framerate
params = sl.StreamingParameters(port=30000)

◆ chunk_size()

def chunk_size (   self)

Defines a single chunk size.

Note
Stream buffers are divided in X number of chunks where each chunk is "chunk_size" bits long.
Default value is 32768. You can lower this value if network generates a lot of packet lost : this will generate more chunks for a single image, but each chunk sent will be lighter to avoid inside-chunk corruption.
Available range : [8192 - 65000]

◆ codec()

def codec (   self)

Defines the codec used for streaming.

Warning
If HEVC is used, make sure the receiving host is compatible with H265 decoding (Pascal NVIDIA card or newer). If not, prefer to use H264 since every compatible NVIDIA card supports H264 decoding

◆ port()

def port (   self)

Defines the port the data will be streamed on.

Warning
port must be an even number. Any odd number will be rejected.

◆ adaptative_bitrate()

def adaptative_bitrate (   self)

Enable/Disable adaptive bitrate.

Note
Bitrate will be adjusted regarding the number of packet loss during streaming.
if activated, bitrate can vary between [bitrate/4, bitrate]
Warning
Bitrate will be adjusted regarding the number of packet loss during streaming.

◆ gop_size()

def gop_size (   self)

Defines the gop size in frame unit.

Note
if value is set to -1, the gop size will match 2 seconds, depending on camera fps.
The gop size determines the maximum distance between IDR/I-frames. Very high GOP sizes will result in slightly more efficient compression, especially on static scenes. But it can result in more latency if IDR/I-frame packet are lost during streaming.
Default value is -1. Maximum allowed value is 256 (frames).

◆ target_framerate()

def target_framerate (   self)

defines the target framerate for the streaming output.

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.

Note
By default 0 means that the camera framerate will be taken