avcodec_decode_video
Overview
Defined in avcodec.h
Decodes a video frame from buf
into picture
.
The avcodec_decode_video() function decodes a video frame from the input buffer buf
of size buf_size
. To decode it, it makes use of the video codec which was coupled with avctx
using avcodec_open(). The resulting decoded frame is stored in picture
.
Warning: The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE
larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end.
Warning: The end of the input buffer buf
should be set to 0 to ensure that no overreading happens for damaged MPEG streams.
Note: You might have to align the input buffer buf
and output buffer samples
. The alignment requirements depend on the CPU: on some CPUs it isn't necessary at all, on others it won't work at all if not aligned and on others it will work but it will have an impact on performance. In practice, the bitstream should have 4 byte alignment at minimum and all sample data should be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do). If the linesize is not a multiple of 16 then there's no sense in aligning the start of the buffer to 16.
int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, uint8_t *buf, int buf_size);
Parameters
avctx
AVCodecContext *avctx
A AVCodecContext pointer to the codec context.
picture
AVFrame *picture
A pointer to the AVFrame in which the decoded video frame will be stored.
got_picture_ptr
int *got_picture_ptr
An int pointer to which zero is written if no frame could be decompressed, otherwise, it is nonzero.
buf
uint8_t *buf
The input buffer.
buf_size
int buf_size
The size of the input buffer in bytes.
Return value
On error a negative value is returned, otherwise the number of bytes used or zero if no frame could be decompressed.
출처 : http://wiki.aasimon.org/doku.php?id=ffmpeg:avcodec_decode_video
'Codec > FFMpeg' 카테고리의 다른 글
ffmpeg user forum (0) | 2012.06.11 |
---|---|
ffmpeg에 있는 example 실행 filtering_video.c (0) | 2012.06.07 |
ffmpeg binary download (0) | 2012.06.05 |
Audio Codec 정보 (0) | 2010.10.21 |
DScaler Deinterlacer/Scaler download (0) | 2010.08.24 |
Avi, Fly 파일을 swf로 변환 하기. (0) | 2010.08.20 |
Streaming을 위한 Open Sources (0) | 2010.08.19 |
FFMPEG 빌드를 해보자. (0) | 2010.08.19 |
동영상 파일 변환 직접 가능~! (0) | 2010.08.19 |
core-avc for linux codec (0) | 2010.07.27 |