RecordingParameters Struct Reference

Structure containing the options used to record. More...

Functions

 RecordingParameters (String video_filename_="myRecording.svo2", SVO_COMPRESSION_MODE compression_mode_=SVO_COMPRESSION_MODE::H264, unsigned int target_framerate_=0, unsigned int bitrate_=0, bool transcode_streaming_input_=false)
 Default constructor. More...
 
bool save (String filename, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON) const
 Saves the current set of parameters into a file to be reloaded with the load() method. More...
 
bool load (String filename, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON)
 Loads a set of parameters from the values contained in a previously saved file. More...
 
bool encode (String &serialized_content, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON) const
 Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string. More...
 
bool decode (const String &serialized_content, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON)
 Fill the structure from the serialized json object contained in the input string. More...
 
bool operator== (const RecordingParameters &param1) const
 
bool operator!= (const RecordingParameters &param1) const
 

Attributes

String video_filename
 Filename of the file to save the recording into. More...
 
SVO_COMPRESSION_MODE compression_mode = SVO_COMPRESSION_MODE::H264
 Compression mode the recording. More...
 
unsigned int bitrate = 0
 Overrides the default bitrate of the SVO file, in kbits/s. More...
 
unsigned int target_framerate = 0
 Framerate for the recording file. More...
 
bool transcode_streaming_input = false
 Defines whether to decode and re-encode a streaming source. More...
 

Detailed Description

Structure containing the options used to record.

The default constructor sets all parameters to their default settings.

Note
Parameters can be adjusted by the user.

Constructor and Destructor

◆ RecordingParameters()

RecordingParameters ( String  video_filename_ = "myRecording.svo2",
SVO_COMPRESSION_MODE  compression_mode_ = SVO_COMPRESSION_MODE::H264,
unsigned int  target_framerate_ = 0,
unsigned int  bitrate_ = 0,
bool  transcode_streaming_input_ = false 
)

Default constructor.

All the parameters are set to their default values.

Functions

◆ save()

bool save ( String  filename,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
) const

Saves the current set of parameters into a file to be reloaded with the load() method.

Parameters
filename: Name of the file which will be created to store the parameters (extension '.yml' will be added if not set).
Returns
True if the file was successfully saved, otherwise false.
Warning
For security reasons, the file must not already exist.
In case a file already exists, the method will return false and existing file will not be updated.

◆ load()

bool load ( String  filename,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
)

Loads a set of parameters from the values contained in a previously saved file.

Parameters
filename: Path to the file from which the parameters will be loaded (extension '.yml' will be added at the end of the filename if not detected).
Returns
True if the file was successfully loaded, otherwise false.

◆ encode()

bool encode ( String serialized_content,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
) const

Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string.

Parameters
serialized_contentoutput string containing the JSON Object
formatserialization format, default is JSON
Returns
True if file was successfully saved, otherwise false.

◆ decode()

bool decode ( const String serialized_content,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
)

Fill the structure from the serialized json object contained in the input string.

Parameters
serialized_contentinput string containing the JSON Object
formatserialization format, default is JSON
Returns
True if the decoding was successful, otherwise false.

◆ operator==()

bool operator== ( const RecordingParameters param1) const

Comparison operator ==

Parameters
RecordingParametersto compare
Returns
true if the two struct are identical

◆ operator!=()

bool operator!= ( const RecordingParameters param1) const

Comparison operator !=

Parameters
RecordingParametersto compare
Returns
true if the two struct are different

Variables

◆ video_filename

String video_filename

Filename of the file to save the recording into.

◆ compression_mode

Compression mode the recording.

Default: sl::SVO_COMPRESSION_MODE::H264

◆ bitrate

unsigned int bitrate = 0

Overrides the default bitrate of the SVO file, in kbits/s.

Default: 0 (the default values associated with the resolution)

Note
Only works if compression_mode is H264 or H265.
Available range: 0 or [1000 - 60000]

◆ target_framerate

unsigned int target_framerate = 0

Framerate for the recording file.

Default: 0 (camera framerate will be taken)

Warning
This framerate must be below or equal to the camera framerate and camera framerate must be a multiple of the target framerate.
It means that it must respect camera_frameratetarget_framerate == 0.
Allowed framerates are 15,30, 60 or 100 if possible.
Any other values will be discarded and camera FPS will be taken.

◆ transcode_streaming_input

bool transcode_streaming_input = false

Defines whether to decode and re-encode a streaming source.

Default: false

Note
If set to false, it will avoid decoding/re-encoding and convert directly streaming input into a SVO file.
This saves a encoding session and can be especially useful on NVIDIA Geforce cards where the number of encoding session is limited.
compression_mode, target_framerate and bitrate will be ignored in this mode.