View Single Post
Old 5th May 2021, 12:48   #12  |  Link
Ritsuka
Registered User
 
Join Date: Mar 2007
Posts: 95
If a player ignores the container PTS/DTS, then that player is hopelessly broken.

videoh code is not entirely correct. MP4 has a feature called "edit lists", and the tkhd box duration is equal to the sum of the durations of all of the track’s edits. But the edits can use less the actual samples in a track, so you can't divide it by the number of samples of the track.

To get the actual frame rate, you would need to calculate the actual presentation timestamp of each sample included in an edit list, and them make an average.
And edit list can change the rate at which samples at played or be a "dwell" without any sample for extra fun.

Refer to the free ISO/IEC 14496-12 Fifth edition pdf for a description of all this fun little features.
Ritsuka is offline   Reply With Quote