Defined in avcodec.h
Encodes a video frame from pict
into buf
.
The avcodec_encode_video() function encodes a video frame from the input pict
. 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
. The input picture should be stored using a specific format, namely avctx.pix_fmt
.
int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVFrame *pict);
AVCodecContext *avctx
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 AVFrame *pict
The input picture to encode in an AVFrame.
On error a negative value is returned, on success zero or the number of bytes used from the input buffer.