0

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 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.
5
  • 1
    In theory, edit lists for meant this, they allow you to construct a virtual presentation timeline. ffmpeg can't write a custom one; don't believe mp4box allows it either but I'm not sure. mp4edit from the bento4 suite should allow to add a handcrafted one to a file. edit lists are per-track.
    – Gyan
    May 24, 2020 at 15:50
  • @Gyan Your comment is close to an answer, I think. A reference to Edit Lists would be nice and also an explanation why this would apparently only be a theoretical solution – do players not support this?
    – Crissov
    May 25, 2020 at 6:45
  • PS: Also, how exactly would Edit Lists be used for this, assuming a 20-second intro starting at 00:50:00.0, the constant frame rate being 30 hertz, using a single video and a single audio track, for instance.
    – Crissov
    May 25, 2020 at 9:24
  • An Edit list is a list of edit entries :) and each entry references the starting timestamp and duration of a segment of the track the list is part of. The timestamp refers to the effective composition timestamp for a track (stts+ctts). And duration is how long the segment lasts, starting from that timestamp. You skip a part of the track by making sure no entry references that portion of the track. It' is the consumer's job to stitch together all segments in a list.
    – Gyan
    May 25, 2020 at 9:45
  • Question: The entry_count should be in edts box and other thing such as version and segment_duration are supposed in the elst box (which is a childbox of edts), right?
    – Han Han
    Nov 8 at 5:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.