Creates an encoder.
....
void encode_callback(
void * user_ptr,
const uint8_t * p_frame,
uint32_t frame_len,
{
}
...
mw_venc_init();
...
mw_venc_handle_t t_handle = NULL;
t_venc_param.
width = 1920;
...
...
...
...
t_fps.num = 30;
...
t_handle = NULL;
...
mw_venc_deinit();
...
mw_venc_status_t mw_venc_put_frame(mw_venc_handle_t handle, uint8_t *p_frame, int64_t pts)
Imports data to encoders.
mw_venc_handle_t mw_venc_create(mw_venc_param_t *p_param, MW_ENCODER_CALLBACK callback, MW_ENCODER_CALLBACK_NALU callback_nalu, void *user_ptr)
Creates an encoder.
mw_venc_status_t mw_venc_get_default_param(mw_venc_param_t *p_param)
Gets the default value of encoding parameters.
mw_venc_status_t mw_venc_set_property(mw_venc_handle_t handle, mw_venc_property_t param, void *args)
Sets encoder parameters.
mw_venc_status_t mw_venc_destory(mw_venc_handle_t handle)
Destroys encoders.
mw_venc_status_t mw_venc_get_property(mw_venc_handle_t handle, mw_venc_property_t param, void *args)
Gets encoder parameters.
enum mw_venc_status mw_venc_status_t
mw_venc_status_t
@ MW_VENC_FOURCC_NV12
NV12 equals MWFOURCC_NV12.
Definition: mw_venc_common.h:200
@ MW_VENC_CODE_TYPE_H264
H264.
Definition: mw_venc_common.h:94
@ MW_VENC_STATUS_SUCCESS
Success.
Definition: mw_venc_common.h:306
@ MW_VENC_TARGETUSAGE_BALANCED
Balance the coding quality and speed.
Definition: mw_venc_common.h:114
@ MW_VENC_PROFILE_H264_MAIN
H264 main.
Definition: mw_venc_common.h:156
@ MW_VENC_RATECONTROL_CBR
Constant Bit Rate.
Definition: mw_venc_common.h:135
@ MW_VENC_PROPERTY_FPS
Frame rate: mw_venc_fps_t default 60/1.
Definition: mw_venc_common.h:290
mw_venc_fps_t
Definition: mw_venc_common.h:257
int32_t den
Denominator of frames.
Definition: mw_venc_common.h:259
mw_venc_frame_info_t @detials Defines the types infomation of frame to be encoded....
Definition: mw_venc_common.h:60
mw_venc_param_t
Definition: mw_venc_common.h:420
mw_venc_targetusage_t targetusage
Preset.
Definition: mw_venc_common.h:423
int32_t height
Height of input video.
Definition: mw_venc_common.h:426
mw_venc_rate_control_t rate_control
Frame control.
Definition: mw_venc_common.h:424
mw_venc_profile_t profile
Profile.
Definition: mw_venc_common.h:431
mw_venc_code_type_t code_type
Code type, H264 or H265.
Definition: mw_venc_common.h:421
int32_t width
width of input video
Definition: mw_venc_common.h:425
mw_venc_fourcc_t fourcc
Color format of input data.
Definition: mw_venc_common.h:422
uint32_t target_bitrate
Target bitrate(kbit/s): only valid when the bitrate is variable or constant.
Definition: mw_venc_common.h:232
mw_venc_rate_control_mode_t mode
Bitrate controlling methods.
Definition: mw_venc_common.h:229