StreamingParameters Class Reference

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

Functions

StreamingParameters __cinit__ (self, codec=STREAMING_CODEC.H265, port=30000, bitrate=0, gop_size=-1, adaptative_bitrate=False, chunk_size=16084, target_framerate=0)
 Default constructor. More...
 
int chunk_size (self)
 Size of a single chunk. More...
 
STREAMING_CODEC codec (self)
 Encoding used for streaming.
 
int port (self)
 Port used for streaming. More...
 
int bitrate (self)
 Defines the streaming bitrate in Kbits/s. More...
 
bool adaptative_bitrate (self)
 Defines whether the adaptive bitrate is enable. More...
 
int gop_size (self)
 GOP size in number of frames. More...
 
int target_framerate (self)
 Framerate for the streaming output. More...
 

Detailed Description

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

The default constructor sets all parameters to their default settings.

Note
Parameters can be adjusted by the user.

Functions

◆ __cinit__()

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

Default constructor.

All the parameters are set to their default values.

Parameters
codec: Chosen codec
port: Chosen port
bitrate: Chosen bitrate
gop_size: Chosen gop_size
adaptative_bitrate: Activtates adaptative_bitrate
chunk_size: Chosen chunk_size
target_framerate: Chosen target_framerate
params = sl.StreamingParameters(port=30000)

◆ chunk_size()

int chunk_size (   self)

Size of a single chunk.

Default: 16084

Note
Stream buffers are divided into X number of chunks where each chunk is chunk_size bytes long.
You can lower chunk_size 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]

◆ port()

int port (   self)

Port used for streaming.

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

◆ bitrate()

int bitrate (   self)

Defines the streaming bitrate in Kbits/s.

STREAMING_CODEC 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]

◆ adaptative_bitrate()

bool adaptative_bitrate (   self)

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).

◆ gop_size()

int gop_size (   self)

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

◆ target_framerate()

int target_framerate (   self)

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.