[Libav-user] number of audio samples while demuxing
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 836 bytes
Desc: Digital signature
More information about the Libav-user