Functions for encoding | |
You must link to libtheoraenc and libtheoradec if you use any of the functions in this section.The functions are listed in the order they are used in a typical encode. The basic steps are:
| |
th_enc_ctx * | th_encode_alloc (const th_info *_info) |
Allocates an encoder instance. | |
int | th_encode_ctl (th_enc_ctx *_enc, int _req, void *_buf, size_t _buf_sz) |
Encoder control function. | |
int | th_encode_flushheader (th_enc_ctx *_enc, th_comment *_comments, ogg_packet *_op) |
Outputs the next header packet. | |
int | th_encode_ycbcr_in (th_enc_ctx *_enc, th_ycbcr_buffer _ycbcr) |
Submits an uncompressed frame to the encoder. | |
int | th_encode_packetout (th_enc_ctx *_enc, int _last, ogg_packet *_op) |
Retrieves encoded video data packets. | |
void | th_encode_free (th_enc_ctx *_enc) |
Frees an allocated encoder instance. |
|
Allocates an encoder instance.
|
|
Encoder control function. This is used to provide advanced control the encoding process.
|
|
Outputs the next header packet. This should be called repeatedly after encoder initialization until it returns 0 in order to get all of the header packets, in order, before encoding actual video data.
|
|
Frees an allocated encoder instance.
|
|
Retrieves encoded video data packets. This should be called repeatedly after each frame is submitted to flush any encoded packets, until it returns 0. The encoder will not buffer these packets as subsequent frames are compressed, so a failure to do so will result in lost video data.
|
|
Submits an uncompressed frame to the encoder.
|