Edit decision list

From Official Kodi Wiki
Revision as of 00:48, 25 December 2009 by >Dteirney
Jump to navigation Jump to search

An edit decision list (EDL) contains information about edits that should be made to the video during playback. Edit decision list information is contained in a separate file to the video that is read by XBMC Media Center just before the video is played. Inspiration for this functionality came from MPlayer EDL support.

The internal video player used by XBMC Media Center (dvdplayer) supports the following types of edits:

  • Cuts - the content is completely removed from playback as if it were never in the original video. For example, the total playback time is adjusted and the content is always automatically skipped during playback, seeking, fast forward or rewind.
  • Commercial Breaks - each commercial break is automatically skipped only once during playback. Commercial breaks that have been skipped can be seen by seeking backwards or rewinding. This is done so incorrectly flagged commercial breaks can see be seen (since commercial detection is rarely 100% accurate). Advanced configuration can help to remove incorrectly flagged breaks and merge commercial breaks that should be contiguous.
  • Scene Markers - these can be used to seek to points of interest within a video similar to how chapter seeking works for DVDs.


Supported File Formats

XBMC Media Center is able to read edit decision lists from multiple file formats. The EDL file for a video must be in the same folder as the video file and is looked for based on the file extensions for the supported formats.

For example if the video file is called The Matrix.avi XBMC will look for the following files, in order, until a valid file is found. Note the the file name may be case-sensitive based on the operating system being used.

  1. The Matrix.Vprj (VideoReDo)
  2. The Matrix.edl (MPlayer EDL)
  3. The Matrix.txt (Comskip)
  4. The Matrix.avi.chapters.xml (SnapStream BeyondTV)

If the video is being played through the MythTV integration, any commercial breaks flagged by MythTV will be used during playback.

VideoReDo

VideoReDo files are supported. The name of the file must be the same as the video but with a file extension of .Vprj.

Only lines starting with <SceneMarker> and <Cut> are read from the file. Each <Cut> is treated as a commercial break. The file format is:

<Version>[ignored]
<Filename>[ignored]
<InputPIDList>
<VideoStreamPID>[ignored]</VideoStreamPID>
<AudioStreamPID>[ignored]</AudioStreamPID>
</InputPIDList>
<SceneMarker [ignored]>[scene marker time] (in ms * 10,000)
<Cut>[start time]:[end time] (both in ms * 10,000)

For example,

<Version>2
<Filename>C:\Path\To\Video.mpg
<InputPIDList>
<VideoStreamPID>224</VideoStreamPID>
<AudioStreamPID>192</AudioStreamPID>
</InputPIDList>
<SceneMarker 1415932542>4235230000
<SceneMarker 1415932543>4284610000
<SceneMarker 1415932544>4585580000
<SceneMarker 1415932545>5035360000
<Cut>4235230000:5936600000
<Cut>9535530000:11527860000
<Cut>14385710000:16090090000

MPlayer EDL

MPlayer EDL files are supported. The name of the file must be the same as the video but with a file extension of .edl.

The file contains the start and end times of the edits along with the type of action associated with each edit. The file format is:

[start second] [end second] [action]

The actions supported by this file format has been extended by XBMC Media Center to include scene marker and commercial break actions. Supported actions are:

  • 0 - Cut
  • 1 - Mute (not implemented)
  • 2 - Scene Marker (the begin second is ignored)
  • 3 - Commercial Break

For example, the following .edl file content will skip from second 5.3 to second 7.1, mute at 15 seconds, unmute at 16.7 seconds (when/if implemented) and commercial skip from 420 seconds to 822 seconds. There will be two scene markers. The first at 255.3 seconds and the next at 720.1 seconds.

5.3   7.1    0
15    16.7   1
420   822    3
1     255.3  2
2     720.1  2

Comskip

Comskip files are supported. The name of the file must be the same as the video but with a file extension of .txt.

The file contains the start and end frame numbers for the commercial breaks that were detected. The Comskip file may or may not contain the frame rate. If the frame rate is not found, the detected frame rate of the video is used to convert from the frame numbers to time offsets.

The version 1 file format is:

FILE PROCESSING COMPLETE
------------------------
[start frame] [end frame]

For example,

FILE PROCESSING COMPLETE
------------------------
12693	17792
28578	34549
43114	48222

The version 2 file format is:

FILE PROCESSING COMPLETE [number of frames] FRAMES AT [frame rate]
------------------------
[start frame] [end frame]

For example,

FILE PROCESSING COMPLETE 678900 FRAMES AT 25
------------------------
12693	17792
28578	34549
43114	48222

SnapStream BeyondTV

BeyondTV files are supported. The name of the file must be the same as the video but with .chapters.xml appended to the filename.

Each <Region> within the XML file is treated as a commercial break. The file format is:

<cutlist>
  <Region>
    <start comment="[start time in hh:mm:ss.sssssss format - ignored]">[start time in ms * 10,000]</start>
    <end comment="[end time in hh:mm:ss.sssssss format - ignored]">[end time in ms * 10,000]</end>
  </Region>
</cutlist>

For example,

<cutlist>
  <Region>
    <start comment="0:07:03.0000523">4235230000</start>
    <end comment="0:09:53.0000660">5936600000</end>
  </Region>
  <Region>
    <start comment="0:15:53.0000553">9535530000</start>
    <end comment="0:19:12.0000786">11527860000</end>
  </Region>
  <Region>
    <start comment="0:23:58.0000571">14385710000</start>
    <end comment="0:26:49.0000009">16090090000</end>
  </Region>
</cutlist>

MythTV

Files that are played through the integrated MythTV support have the commercial breaks loaded from mythbackend.

Scene Markers are additionally put in at the beginning and end of the flagged commercial breaks.

Commercial Break Merging

TODO: Describe how commercial breaks can be merged using the advanced settings.

Showing EDL Information During Playback

Information about the EDL status for the video can be obtained by showing the codec information during playback. Typically this is shown by pressing o on a keyboard or pressing the Title button on the XBox remote. See Keymap.xml for more information.

When the codec information for the playing video is shown on screen, e.g. the video and stream codecs being used, framerate, number of dropped frames etc. information about the EDL status will also be displayed. Edit decision list information is prefixed with edl: and followed by a dash or letters followed by numbers. The letter describes the type of edit and the following number the count of that type. For example, edl: c4s8 means there are 4 commercial breaks and 8 scene markers.

  • c = cut
  • m = mute
  • b = commercial break
  • s = scene marker
  • - (dash) = no edit decision list

Using Scene Markers

To use any scene markers that have been read, buttons on the remote need to be configured to go to the next/previous scene marker. These buttons must use the NextScene and PreviousScene codes from Keymap.xml.

External Player Support

The edit decision list information that has been read by XBMC can be used by the external MPlayer through a temporary .edl file that is generated by XBMC to a known location. Since MPlayer only supports cuts and mutes any scene markers that have been read are ignored and any commercial breaks that have been read are converted to cuts.

Not Implemented

  • Compensation for cuts when percentage seeking is used and the movie length is unknown
  • Muting

Known Issues

  • MPlayer sometimes ignores search parameters, see Bug-Report #1803075