[FFmpeg-devel] AVCodec struct fields (encode function prototype)

Dang Le babyprez
Fri Oct 22 15:04:41 CEST 2010


  Ooops.... Thank you for your prompt response, Ronald.
I get it now.

Regards,
Le Hong Dang.


On 10/22/2010 6:35 PM, Ronald S. Bultje wrote:
> Hi,
>
> On Fri, Oct 22, 2010 at 6:25 AM, Dang Le<babyprez at gmail.com>  wrote:
>> Hi all,
>> I'm writing my own codec for ffmpeg.
>> I have completed the decoder and it works well thanks to nice explanations
>> about the parameters of decode frame function from here:
>>
>> http://wiki.multimedia.cx/index.php?title=FFmpeg_codec_HOWTO#libavcodec.2Fcook.c_Decode
>>
>> Unfortunately, there's no documentation on the encode frame function
>> (parameters&  return value) out there.
>> Could someone please help me to understand those params?
>>
>> The function prototype is:
>> int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
>>
>> Particularly: buf, buf_size and data. which is the input, which is the
>> output?
>> Do I have to av_malloc memory for the output or not?
> void *data, for video, is a AVFrame *pict which contains uncompressed input.
>
> buf/buf_size is output buffer and max buffer size. The return value of
> the function should be the number of bytes actually filled. See also
> avcodec_encode_video() and its documentation.
>
> Ronald
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>



More information about the ffmpeg-devel mailing list