ffmpeg:avcodec_encode_audio
This is an old revision of the document!
Table of Contents
avcodec_encode_audio
Overview
Defined in avcodec.h
Encodes an audio frame from samples
into buf
.
The avcodec_encode_audio() function encodes an audio frame from the input buffer samples
. To encode it, it makes use of the audio codec which was coupled with avctx
using avcodec_open(). The resulting encoded frame is stored in output buffer buf
.
Note: The output buffer should be at least FF_MIN_BUFFER_SIZE
bytes large.
int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples);
Parameters
avctx
AVCodecContext *avctx
avctx the AVCodecContext codec context.
buf
<uint8_t *buf/code> The output buffer. ===buf_size=== <code c>int buf_size
The output buffer size.
samples
const short *samples
The input buffer containing the samples.
Return value
On error a negative value is returned, on succes zero or the number of bytes used from the input buffer.
See also
ffmpeg/avcodec_encode_audio.1197639105.txt.gz · Last modified: 2007/12/14 14:31 by deva