Is there a standardized way to mark up specific parts of a MP4-contained video as skippable, e.g. trailers, recaps, intros/outros, opening/closing credits, in the metadata in the file itself? If possible, I would like to set this with FFmpeg or MP4box.
I know that the mvhd
box in MOV files makes it possible to specify a single preview.
I assume Netflix and the like use specially named or hinted chapters, either from file-internal metadata or from a central database, to provide this feature.
I want to add this now to videos in my personal library, just in case Kodi, VLC or other players and media centers add support for this feature.
Edit List Box elst
As mentioned in the first comment, Edit Lists may be a solution. They are specified in section 8.6.6 of ISO/IEC 14496-12:2015 (ISOBMFF), which I partially cite below.
moov
> trak
+ > edts
? > elst
*
[
elst
] contains an explicit time-line map. Each entry defines part of the track time-line:
by mapping part of the media time-line,
or by indicating ‘empty’ time,
or by defining a ‘dwell’, where a single time-point in the media is held for a period.
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 tablesegment_duration
is an integer that specifies the duration of this edit segment in units of the timescale in the Movie Header Boxmedia_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.
entry_count
should be inedts
box and other thing such asversion
andsegment_duration
are supposed in theelst
box (which is a childbox ofedts
), right?