![]() |
Open Broadcaster Software
Free, open source software for live streaming and recording
|
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 |
void(* | get_defaults2 )(obs_data_t *settings, void *type_data) |
obs_properties_t *(* | get_properties2 )(void *data, void *type_data) |
bool(* | encode_texture )(void *data, uint32_t handle, int64_t pts, uint64_t lock_key, uint64_t *next_key, struct encoder_packet *packet, bool *received_packet) |
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.
uint32_t obs_encoder_info::caps |
const char* obs_encoder_info::codec |
Specifies the codec
void*(* obs_encoder_info::create) (obs_data_t *settings, obs_encoder_t *encoder) |
Creates the encoder with the specified settings
settings | Settings for the encoder |
encoder | OBS encoder context |
void(* obs_encoder_info::destroy) (void *data) |
Destroys the encoder data
data | Data associated with this encoder context |
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.
data | Data associated with this encoder context | |
[in] | frame | Raw audio/video data to encode |
[out] | packet | Encoder packet output, if any |
[out] | received_packet | Set to true if a packet was received, false otherwise |
bool(* obs_encoder_info::encode_texture) (void *data, uint32_t handle, int64_t pts, uint64_t lock_key, uint64_t *next_key, struct encoder_packet *packet, bool *received_packet) |
void(* obs_encoder_info::free_type_data) (void *type_data) |
void(* obs_encoder_info::get_audio_info) (void *data, struct audio_convert_info *info) |
Returns desired audio format and sample information
data | Data associated with this encoder context |
[in/out] | info Audio format information |
void(* obs_encoder_info::get_defaults) (obs_data_t *settings) |
Gets the default settings for this encoder
[out] | settings | Data to assign default settings to |
void(* obs_encoder_info::get_defaults2) (obs_data_t *settings, void *type_data) |
Gets the default settings for this encoder
If get_defaults is also defined both will be called, and the first call will be to get_defaults, then to get_defaults2.
[out] | settings | Data to assign default settings to |
[in] | typedata | Type 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)
data | Data associated with this encoder context | |
[out] | extra_data | Pointer to receive the extra data |
[out] | size | Pointer to receive the size of the extra data |
size_t(* obs_encoder_info::get_frame_size) (void *data) |
Audio encoder only: Returns the frame size for this encoder
const char*(* obs_encoder_info::get_name) (void *type_data) |
Gets the full translated name of this encoder
type_data | The type_data variable of this structure |
obs_properties_t*(* obs_encoder_info::get_properties) (void *data) |
Gets the property information of this encoder
obs_properties_t*(* obs_encoder_info::get_properties2) (void *data, void *type_data) |
Gets the property information of this encoder
[in] | data | Pointer from create (or null) |
[in] | typedata | Type Data |
bool(* obs_encoder_info::get_sei_data) (void *data, uint8_t **sei_data, size_t *size) |
Gets the SEI data, if any
data | Data associated with this encoder context | |
[out] | sei_data | Pointer to receive the SEI data |
[out] | size | Pointer to receive the SEI data size |
void(* obs_encoder_info::get_video_info) (void *data, struct video_scale_info *info) |
Returns desired video format information
data | Data associated with this encoder context |
[in/out] | info Video format information |
const char* obs_encoder_info::id |
Specifies the named identifier of this encoder
enum obs_encoder_type obs_encoder_info::type |
Specifies the encoder type (video or audio)
void* obs_encoder_info::type_data |
bool(* obs_encoder_info::update) (void *data, obs_data_t *settings) |
Updates the settings for this encoder (usually used for things like changing bitrate while active)
data | Data associated with this encoder context |
settings | New settings for this encoder |