Defined in avcodec.h
Encodes a subtitle frame from sub
into buf
.
The avcodec_encode_subtitle() function encodes a video frame from the input sub
. To encode it, it makes use of the video codec which was coupled with avctx
using avcodec_open(). The resulting encoded bytes representing the frame are stored in the output buffer buf
.
int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub);
AVCodecContext *avctx
The AVCodecContext codec context.
uint8_t *buf
The output buffer for the bitstream of encoded frame.
int buf_size
The size of the output buffer in bytes.
const AVSubtitle *sub
The input AVSubtitle subtitle to encode.
On error a negative value is returned, on success zero or the number of bytes used from the input buffer.