On Sun, 24 Aug 2008 19:10:04 -0400, Frédéric Jolliton  
<[EMAIL PROTECTED]> wrote:

> Hi,
>
>> In the attached program, we can see that the DTS sequence obtained,
>> while decoding frame or not, differ. Sometimes there is no DTS
>> (NO_OPTS_VALUE) but this doesn't happen if we do not decode the frames.
>>
>> So, is there a bug in my attached program or does ffmpeg act
>> strangely?
>
> After several hours of debug, I found why it act like this.
>
> As I was supposing it, packets fields from `av_read_frame' can depends
> of the state of the codec context. The function `compute_frame_duration'
> is testing `st->codec->time_base'. This value is probably updated when
> decoding frame.

You have pretty much figured it out.  But to help clarify the reasons:

   stream->* and AVPacket->* hold information about the demuxer (which is  
invoked when you av_read_frame)

   stream->codec->* and AVFrame->* contain data about the codec (which is  
invoked when you avcodec_decode_video)

There is very little connection between the codec and the demuxer.  It is  
possible to have a container with PTS values and a codec without them.  It  
is possible to have container PTS and codec PTS that have both a different  
rate and different starting value.

-Mike
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to