0
votes

I'm using ffms2(ffmpegsource) a wrapper around libav to get video and audio frame from a file. Video decoding is working fine. However I'm facing some issues with audio decoding. FFMS2 provide a simple function FFMS_GetAudio(FFMS_AudioSource *A, void *Buf, int64_t Start, int64_t Count, FFMS_ErrorInfo *ErrorInfo); api to get the decoded buffer. The decoded data is return in buffer provided by user.

For single channel the data is interpretation is straight forward with data byte starting from first location of user buffer. However when it comes to two channel there are two possibilities the decoded data could be planar or interleaved depending upon sample format return by FFMS_GetAudioProperties. In my case the sample format is always planar which means that decoded data will in two sperate data plane data[0] and data[1]. And this is what is explained by libav/ffmpeg and also by portaudio which consider planar data to be in two separate data plane.

However FFMS_GetAudio just take single buffer from user. So can I assume for planar data data[0] = buf, data[1] = buf + offset, where offset is half the length of buffer return by FFMS_GetAudio.

FFMS does not provide any good document for this interpretation. It would be great help if some can provide more information on this.

1

1 Answers

1
votes

FFMS2 currently does not support outputting planar audio. More recent revisions (post-2.17) automatically interleave planar audio, while older versions from before libav added support for planar audio simply ignore all planes after the first.