[Libav-user] number of audio samples while demuxing

Nicolas George george at nsup.org
Wed Nov 13 19:20:02 CET 2013

Le tridi 23 brumaire, an CCXXII, Nisar Ahmed a écrit :
> Most of the time it will be LPCM but it can be AAC as well.

The LPCM case is particular, since the samples are directly there. They have
been packetized to be stored in the container, though, and that is what
av_read_frame() will return you. You can try to control the packet structure
of the input file, but that is very fragile.

With specialized formats, such as WAVE, there are no packets and you could
rely on the block_align parameter, but this is fragile too anyway, so it
would not be a good idea.

Also, you should probably be calling a decoder anyway, to handle the
endianness and other nasty issues.

For the AAC case, there is nothing you can do, you will need to call a
decoder, and it will return how many samples it wants, possibly a variable
amount on a single file.

> On Wed, Nov 13, 2013 at 6:23 PM, Nicolas George <george-ls1+KW1iHyU at public.gmane.org> wrote:

Please do not top-post on these mailing lists. If you do not know what it
means, look it up.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131113/3573bb9d/attachment.asc>

More information about the Libav-user mailing list