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

你可能感兴趣的:(Timescale & Duration in MP4 Format)