[Ffmpeg-devel] Re: [PATCH] mov fix fps detection
Tue Aug 8 03:01:21 CEST 2006
Uoti Urpala wrote:
> On Tue, 2006-08-08 at 00:26 +0200, Baptiste Coudurier wrote:
>> Quoting from ISO 14496-12:
>> stream may be the same. Great care must
>> be taken when adding samples to a stream, that the sample that was
>> previously last may need to have a non-
>> zero duration established, in order to observe this rule. If the
>> duration of the last sample is indeterminate, use
>> an arbitrary small value and a `dwell' edit."
>> + /* ISO 14496-12 8.15, workaround since last entry may have an 'abritraty small value' */
>> + if (entries > 1 && i == entries - 1 && sample_count == 1)
>> + sample_duration = sc->stts_data[i - 1].duration;
>> sc->stts_data[i].count= sample_count;
>> sc->stts_data[i].duration= sample_duration;
> The quote isn't talking about setting the last entry in a stream. It's
> about handling samples which will NOT be last any more because new
> samples are added.
Well you are only interpreting the last sentence in the "adding new
Last sentence may explains in general that last sample duration may have
an 'abritraty value' or be 0 if duration is indeteminate. That situation
appears oftenly in samples.
To resolve the problem, I chose to set last value and increase duration.
I can also ignore last sample. If you think more you will realize that
cfr is indeed achieved even if last sample duration is 0 or any
'abritraty small' value, since stts actually reflects time BETWEEN samples.
Currently time rate is set wrongly when last sample has that 'abritrary
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A. http://www.smartjog.com
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312
More information about the ffmpeg-devel