Timescale & Duration in MP4 Format

mvhd (Movie Header)

  • Time scale
    A time value that indicates the time scale for this movie—that is, the number of time units that pass per second in its time coordinate system.
  • Duration
    A time value that indicates the duration of the movie in time scale units.
    Note that this property is derived from the movie’s tracks. The value of this field corresponds to the duration of the longest track in the movie.
# 非常重要的公式
duration/timescale= 影片长度(单位:秒)      # 利用mvhd的timescale和duration进行计算

tkhd (Track Header)

  • Duration
    A time value that indicates the duration of this track (in the movie’s time coordinate system).
    Note that this property is derived from the track’s edits. The value of this field is equal to the sum of the durations of all of the track’s edits. If there is no edit list, then the duration is the sum of the sample durations, converted into the movie timescale.

mdhd (Media Header)

  • Time scale
    A time value that indicates the time scale for this media—that is, the number of time units that pass per second in its time coordinate system.
  • Duration
    The duration of this media in units of its time scale.

Perferences:
http://www.cnblogs.com/goodloop/archive/2010/11/08/1872004.html
http://www.52rd.com/Blog/Detail_RD.Blog_wqyuwss_7928.html

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容