[Ffmpeg-devel] [PATCH] mov fix fps detection

Baptiste Coudurier baptiste.coudurier
Tue Aug 8 00:26:08 CEST 2006


Here is an attempt to fix somewhat fps detection.
Quoting from ISO 14496-12:

"The time to sample boxes must give non-zero durations for all samples
with the possible exception of the last
one. Durations in the `stts' box are strictly positive (non-zero),
except for the very last entry, which may be
zero. This rule derives from the rule that no two time-stamps in a
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."

According to what I understand, It could be possible to safely ignore
stts value of last packet, I chose to copy last duration, since it
illustrates well 'an arbitrary small value' and fix fps detection
problem. Duration will then be updated accordingly, other change is to
avoid overwriting readjusted duration afterwards.
Maybe I should ensure that entries == 2 ?

Is that acceptable ?

Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mov_ignore_last_stts.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060808/62c307f9/attachment.txt>

More information about the ffmpeg-devel mailing list