I am trying to learn MP4 Boxes and I saw this document on the internet. On 8.26 (Page 43), it said that:
An Edit Box maps the presentation time-line to the media time-line as it is stored in the file. The Edit Box is a container for the edit lists.
version is an integer that specifies the version of this box (0 or 1)
entry_count is an integer that gives the number of entries in the following table
segment_duration is an integer that specifies the duration of this edit segment in units of the timescale in the Movie Header Box
media_time is an integer containing the starting time within the media of this edit segment (in media time scale units, in composition time). If this field is set to –1, it is an empty edit. The last edit in a track shall never be an empty edit. Any difference between the duration in the Movie Header Box, and the track’s duration is expressed as an implicit empty edit at the end.
media_rate specifies the relative rate at which to play the media corresponding to this edit segment. If this value is 0, then the edit is specifying a ‘dwell’: the media at media-time is presented for the segment-duration. Otherwise this field shall contain the value 1.
This is the relationship:
edts
|____elst
|____elst
As I know, entry_count
should be put in the edts
box, but there is a field called version
, which controls the size of segment_duration
, media_time
, and media_rate
. However, the document did not really clarify where is version
.
In that case, should the version
field in edts
box or in elst
box?
It goes in the elst box.
edts is only 8 bytes. Where it holds 4 bytes for size then 4 bytes for actual text characters of "edts".
The first 4 bytes (SIZE part) means total bytes from the start of text edts up to the last byte of the elst data(s).
The total then gets a
+4
added to account for length of those starting 4 bytes of SIZE).