Open Broadcaster Software
Free, open source software for live streaming and recording
obs_encoder_info Struct Reference

Data Fields

const char * id
 
enum obs_encoder_type type
 
const char * codec
 
const char *(* get_name )(void *type_data)
 
void *(* create )(obs_data_t *settings, obs_encoder_t *encoder)
 
void(* destroy )(void *data)
 
bool(* encode )(void *data, struct encoder_frame *frame, struct encoder_packet *packet, bool *received_packet)
 
size_t(* get_frame_size )(void *data)
 
void(* get_defaults )(obs_data_t *settings)
 
obs_properties_t *(* get_properties )(void *data)
 
bool(* update )(void *data, obs_data_t *settings)
 
bool(* get_extra_data )(void *data, uint8_t **extra_data, size_t *size)
 
bool(* get_sei_data )(void *data, uint8_t **sei_data, size_t *size)
 
void(* get_audio_info )(void *data, struct audio_convert_info *info)
 
void(* get_video_info )(void *data, struct video_scale_info *info)
 
void * type_data
 
void(* free_type_data )(void *type_data)
 
uint32_t caps
 

Detailed Description

Encoder interface

Encoders have a limited usage with OBS. You are not generally supposed to implement every encoder out there. Generally, these are limited or specific encoders for h264/aac for streaming and recording. It doesn't have to be just h264 or aac of course, but generally those are the expected encoders.

That being said, other encoders will be kept in mind for future use.

Field Documentation

§ caps

uint32_t obs_encoder_info::caps

§ codec

const char* obs_encoder_info::codec

Specifies the codec

§ create

void*(* obs_encoder_info::create) (obs_data_t *settings, obs_encoder_t *encoder)

Creates the encoder with the specified settings

Parameters
settingsSettings for the encoder
encoderOBS encoder context
Returns
Data associated with this encoder context, or NULL if initialization failed.

§ destroy

void(* obs_encoder_info::destroy) (void *data)

Destroys the encoder data

Parameters
dataData associated with this encoder context

§ encode

bool(* obs_encoder_info::encode) (void *data, struct encoder_frame *frame, struct encoder_packet *packet, bool *received_packet)

Encodes frame(s), and outputs encoded packets as they become available.

Parameters
dataData associated with this encoder context
[in]frameRaw audio/video data to encode
[out]packetEncoder packet output, if any
[out]received_packetSet to true if a packet was received, false otherwise
Returns
true if successful, false otherwise.

§ free_type_data

void(* obs_encoder_info::free_type_data) (void *type_data)

§ get_audio_info

void(* obs_encoder_info::get_audio_info) (void *data, struct audio_convert_info *info)

Returns desired audio format and sample information

Parameters
dataData associated with this encoder context

§ get_defaults

void(* obs_encoder_info::get_defaults) (obs_data_t *settings)

Gets the default settings for this encoder

Parameters
[out]settingsData to assign default settings to

§ get_extra_data

bool(* obs_encoder_info::get_extra_data) (void *data, uint8_t **extra_data, size_t *size)

Returns extra data associated with this encoder (usually header)

Parameters
dataData associated with this encoder context
[out]extra_dataPointer to receive the extra data
[out]sizePointer to receive the size of the extra data
Returns
true if extra data available, false otherwise

§ get_frame_size

size_t(* obs_encoder_info::get_frame_size) (void *data)

Audio encoder only: Returns the frame size for this encoder

§ get_name

const char*(* obs_encoder_info::get_name) (void *type_data)

Gets the full translated name of this encoder

Parameters
type_dataThe type_data variable of this structure
Returns
Translated name of the encoder

§ get_properties

obs_properties_t*(* obs_encoder_info::get_properties) (void *data)

Gets the property information of this encoder

Returns
The properties data

§ get_sei_data

bool(* obs_encoder_info::get_sei_data) (void *data, uint8_t **sei_data, size_t *size)

Gets the SEI data, if any

Parameters
dataData associated with this encoder context
[out]sei_dataPointer to receive the SEI data
[out]sizePointer to receive the SEI data size
Returns
true if SEI data available, false otherwise

§ get_video_info

void(* obs_encoder_info::get_video_info) (void *data, struct video_scale_info *info)

Returns desired video format information

Parameters
dataData associated with this encoder context

§ id

const char* obs_encoder_info::id

Specifies the named identifier of this encoder

§ type

enum obs_encoder_type obs_encoder_info::type

Specifies the encoder type (video or audio)

§ type_data

void* obs_encoder_info::type_data

§ update

bool(* obs_encoder_info::update) (void *data, obs_data_t *settings)

Updates the settings for this encoder (usually used for things like changeing birate while active)

Parameters
dataData associated with this encoder context
settingsNew settings for this encoder
Returns
true if successful, false otherwise

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