Le septidi 17 floréal, an CCXXI, Pradeep Karosiya a écrit :
> I'm trying to encode raw audio samples. Though encoding is working fine. I'm
> not able to understand some of the field of AVFrame specially related to
> planar data.
> Can someone explain what is the different between data and extended_data in
> AVFrame and how they are use during encoding. 

data serves when there are at most 8 channels, extended_data serves when
there are more using a mallocated array of pointers. If in doubt, use
extended_data, since it will always be a valid pointer, either to a
mallocated or just to data.

> I got the linesize which says that it contains the size of each channel. 
> But how the raw samples are stored in this structure.

One after the other. Just cast the pointer to an arithmetic type of the
correct size: "samples = (int16_t *)extended_data[channel]" for S16, etc.

> Also do I need explicitly free memory buffers allocated during encoding?

Depends how they were allocated. Using refcounted buffers is the preferred
method nowadays.

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to