[Libav-user] avi pcm messed up

Anton Shekhovtsov shekh.anton at gmail.com
Wed Nov 26 16:48:18 CET 2014


2014-11-26 16:32 GMT+02:00 wm4 <nfxjfg at googlemail.com>:

> On Wed, 26 Nov 2014 16:24:35 +0200
> Anton Shekhovtsov <shekh.anton at gmail.com> wrote:
>
> > Hi,
> > I have some inconsistencies with pcm audio stream in avi format.
> > The file is transcoded from valid h264, aac mp4 with simple ffmpeg
> command
> > line "-c:v h264 -c:a pcm_s16le". Also repeated same transcoding to mov
> > format.
> >
> > 1) AVStream.duration is not specified - fine in mov
>
> It doesn't need to be set. Whether it is depends on the format. You
> could probably fallback to the overall duration.
>
> > 2) AVStream.nb_frames is the number of samples (the same as expected
> > duration) - same in mov
> >
> > 3) AVIndexEntry.timestamp is in bytes not samples - fine in mov
> > I guess it is in bytes because if I take timestamp from last index entry,
> > add size and divide by 4 I get exactly the number of samples.
>
> This is private API. AVIndexEntry isn't explicitly marked private,
> but the only place where it's used (AVStream.index_entries) is marked
> as not being part of the public API.
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>


1)
I understand it is optional but seems unnecessary complication to not set
it when it should be trivially available.

3)
Sorry, I was disappointed by generic av_index_search which takes timestamp
directly. Now I see where it is: avi_read_seek does multiply timestamp by
sample_size. I will rethink my code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20141126/07316bfd/attachment.html>


More information about the Libav-user mailing list