Edit decision list: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>DrDDT
No edit summary
(80 intermediate revisions by 14 users not shown)
Line 1: Line 1:
<i>Edit Decision List</i> (EDL) support.
{{mininav| [[Video library]] {{l2| [[Live TV]] }} }}
* The edit decision list (EDL) system allows you to automatically skip or mute sections of videos during playback, based on a movie specific EDL configuration file. This can for example be used for commercial skipping.  
<section begin="intro" />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 Kodi just before the video is played. Examples of use include can be to skip commercials, cut out content inappropriate for children, or skip over the half hour acid trip in ''2001: A Space Odyssey'' . <section end="intro" />


<i>Scenemarkers</i> (Chapter file) support.
Inspiration for this functionality came from [http://www.mplayerhq.hu/DOCS/HTML/en/edl.html MPlayer EDL support].
*Jump from scene to scene, like with DVD chapters.


The internal video player ([[VideoPlayer]]) used by Kodi supports the following types of edits:
* '''Cut''' - 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.
* '''Mute''' - the audio is muted, video continues playing.
* '''Scene Marker''' - these can be used to seek to points of interest within a video similar to how chapter seeking works for DVDs.
* '''Commercial Break''' - each commercial break is automatically skipped once during playback. Since commercial detection is rarely 100% accurate, commercial breaks that have already been skipped can be re-entered by seeking backwards or rewinding. If an incorrectly flagged commercial break is automatically skipped, pressing {{keypress|down}} (big skip backwards) within 10 seconds will jump back to the start of the commercial break. Pressing {{keypress|up}} (big skip forward) within a flagged commercial break will go to the end of the commercial break.


<br />
{{bigger|{{note|'''If using actual .EDL files the following field must be added to comskip.ini:'''}} }}
<br /><br />


===Features===
<pre>
edl_skip_field=3
</pre>
 
By default this value will be 0 in Comskip, and Kodi will see them as '''Cut''' actions and remove the section from the video (i.e. a 30 minute video would appear as 22 minutes with commericals removed). Setting this value overrides this behaviour allowing Kodi to treat it as a '''Commercial Break'''.
 
With edl_skip_field=3 , the full video file is visible, but Kdoi will skip the marked commercials the first time it attempts to play them. If, after commercials are skipped, you skip back through the recording (into a commercial area), you can then watch the video that was marked as a commercial.
 
(thanks '''sbthomas''' for the solution)
 
<br />
 
= Supported File Formats =
 
Kodi 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.


*Support for EDLs/Scenemarkers in the following formats:
For example if the video file is called '''The Matrix.avi''' Kodi 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.
** EDL (Edit Decision List) .edl format with added type '2' for scenemarkers
# '''The Matrix.Vprj''' (VideoReDo)
** ComSkip .txt format (with framerate information)
# '''The Matrix.edl''' (MPlayer EDL)
** VideoReDo version 2 .vprj format
# '''The Matrix.txt''' (Comskip)
** SnapStream Beyond TV Smart Chapters (a.k.a. smartskip) .chapters.xml format.
# '''The Matrix.avi.chapters.xml''' (SnapStream BeyondTV)


* Automatically adjusts seeking so cutpoints are skipped.


* EDL/Scenemarker usage information in video information.


* Supported for MPlayer and DVDPlayer
== MPlayer EDL ==


===Usage===
Classic [http://www.mplayerhq.hu/DOCS/HTML/en/edl.html MPlayer EDL] files are supported. Kodi also supports an extended version of this file format that allows extra functionality as outlined below. The name of the file must be the same as the video file but with a file extension of '''.edl'''.
To use a specific format with a video file, put it in the same folder as the video file.  
The EDL/Scenemarker file and video file must have the same name. <br>For example:


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:
<pre>
<pre>
Video File:  The Matrix.avi
[start time] [end time] [action]
 
EDL:        The Matrix.edl
Comskip:    The Matrix.txt
VideoReDo:  The Matrix.vprj
SnapStream:  The Matrix.avi.chapters.xml
</pre>
</pre>
When multiple formats are available, XBMC will read them in the following order, until a valid file is read: VideoReDo, EDL, Comskip, SnapStream.
=EDL format with scenemarkers extension=
An Edit Decision List or EDL allows you to automatically skip or mute sections of videos during playback, based on a movie specific EDL configuration file. The EDL can for example be used to to skip commecials or intros. XBMC adds a third option to use scenemarkers. Scenemarkers can be used to quickly jump to a scene, similar to DVD chapters.


The current EDL file format is:
Start and end times can be defined as seconds, HH:MM:SS.sss, or frames. To specify frames precede the frame number with the # symbol. The original MPlayer EDL files only support seconds for start and end times.
[begin second] [end second] [action]


Where the seconds are floating-point numbers and the action is either 0 for skip, 1 for mute and 2 for a scene marker. Example:
The actions supported by this file format have also been extended by Kodi to include Scene Marker and Commercial Break actions since the original format only supports Cut and Mute. Supported actions are:
* 0 - Cut
* 1 - Mute
* 2 - Scene Marker (if start and end times are specified, the end time is used)
* 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, 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.
<pre>
<pre>
5.3  7.1    0
5.3  7.1    0
15    16.7  1
15    16.7  1
420  422   0
420  822   3
1    255.3  2
1    255.3  2
2    720.1 2
720.1       2
</pre>
</pre>


This will skip from second 5.3 to second 7.1 of the video, then mute at 15 seconds, unmute at 16.7 seconds and skip from second 420 to second 422 of the video. These actions will be performed when the playback timer reaches the times given in the file.  
The following .edl file content will skip from frame 127 to frame 170, mute at frame 360, unmute at frame 400, and commercial skip from frame 10080 to frame 19728. There will be two scene markers. The first at frame 6127 and the next at frame 17282. Note that when using frame numbers TS files are not supported, other file formats that correctly provide frame rate will work.
The scenemarkers '1' and '2' can be used to directly jump to second 255.3 and 720.1 in the video.
<pre>
The first number is the scene number (not used yet), the second the seek value in seconds, the third is the 'scene marker' type indicator. The scenemarker data is not passed to mplayer, but is only used as internal data format.
#127  #170    0
#360  #400    1
#10080 #19728  3
#1     #6127  2
#17282        2
</pre>


=SceneMarker seeking=
The following .edl file content will skip from second 5.3 to second 7.1, mute at 15 seconds, unmute at 16.7 seconds, and commercial skip from 7 minutes to 13 minutes and 42 seconds. There will be two scene markers. The first at 4 minutes and 15.3 seconds and the next at 12 minutes and 0.1 seconds.
To assign a button for next/previous scenemarker, use the NextScene/PreviousScene codes in keymap.xml.
For example to assing the <nowiki>|< and >|</nowiki> buttons on the xbox remote in full screen video:
<pre>
<pre>
<FullscreenVideo>
5.3    7.1    0
    <remote>
15      16.7    1
       <skipplus>NextScene</skipplus>
7:00    13:42  3
      <skipminus>PreviousScene</skipminus>
1       4:15.3  2
12:00.1        2
</pre>
</pre>


=EDL information display=
Seconds and HH:MM:SS.sss can be accurately specified to three decimal places. Currently EDL cuts and mutes are frame accurate when specifying frames. Frames are specified inclusive (specify first frame to cut and last frame to cut).
Pressing the Black button (Title on the remote) will show the some information regarding the currently playing video stream, such as codecs, framerate and so on. The following edl info is available:
 
{{future|19|In Kodi v19, the addition of handling a comment line has been added. These lines are defined as beginning with ##<br>Kodi will ignore any lines beginning with ## and continue processing the EDL file.}}
 
== VideoReDo ==
 
[http://www.videoredo.com/ 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:
<pre>
<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)
</pre>
 
For example,
<pre>
<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
</pre>
 
== Comskip ==
 
[http://www.kaashoek.com/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. Note that for TS files only the version 2 format is supported (where frame rate is suppplied).
 
The version 1 file format is:
<pre>
FILE PROCESSING COMPLETE
------------------------
[start frame] [end frame]
</pre>
 
For example,
<pre>
FILE PROCESSING COMPLETE
------------------------
12693 17792
28578 34549
43114 48222
</pre>
 
The version 2 file format is:
<pre>
FILE PROCESSING COMPLETE [number of frames] FRAMES AT [frame rate]
------------------------
[start frame] [end frame]
</pre>
 
For example,
<pre>
FILE PROCESSING COMPLETE 678900 FRAMES AT 25
------------------------
12693 17792
28578 34549
43114 48222
</pre>
 
== SnapStream BeyondTV ==
 
[http://www.snapstream.com/products/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:
<pre>
<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>
</pre>
 
For example,
<pre>
<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>
</pre>
 
 
= Merging or Removing Short Commercial Breaks =
 
The [[Advancedsettings.xml#.3Cedl.3E|<edl> section of advancedsettings.xml]] can be used to:
* Merge commercial breaks within a set of commercials that haven't been detected accurately. Very useful if you find that automatically skipped commercial breaks still end up within a set of commercial breaks.
* Remove commercial breaks that are incorrectly identified outside of a likely set of commercial breaks. Very useful if you find that commercial skipping is happening unexpectedly while watching the TV show or Movie.
 
= Altering Automatic Skip Timings =
 
The [[Advancedsettings.xml#.3Cedl.3E|<edl> section of advancedsettings.xml]] also can be used to:
* Set how long to wait before automatically skipping when the start of a commercial break is reached. Useful if the automatic skip at the start of a set of commercial breaks is happening slightly too early for your liking, particularly if you aren't ever quite sure if that was a commercial that was about to start.
* Set how long to rewind after automatically skipping to the end of the commercial break. Useful if it's kind of hard to tell if that was in fact the start of the TV show after a block of commercials.
 
= Showing EDL Information During Playback =
Display of EDL information was removed for v17 and v18 with the redesign of the Codec information windows.
{{Future|19|EDL markers will be visible on the video player OSD. See [https://github.com/xbmc/xbmc/pull/15767 PR15767]}}
 
 
 
= Using Scene Markers =


* 'edl:n:b:e:s is available in the video status screen, with the following meaning:
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]].
** n: no edl/scenemarkers
** b: edl and scenemarkers
** s: scenemarkers
** e: edl


=Not implemented=
* Compensation for cutpoint when movie length is unknown and percentage seeking is used.
* Visual cutpoints/scenemarkers on video progress bar.
* EDL support for the DVD player core.


=Possible issues=
{{updated|18}}


* Only supports the MPlayer core.
* The readers now stop reading at the first format error, and invalidates the EDL.
* Should one be able to go to a scenemarker inside a cutpoint? For now, you can.
* MPlayer sometimes seems to ignore search parameters, see Bug-report #1803075.


=Possible future expansions=
[[Category:PVR]]
* Read other scene marker formats, like DVD authoring formats, so DVD-Rips can have the original Scene markers.
[[Category:Manual]]
* Read other EDL/chapter file formats
[[Category:Video library]]
* Support for the DVD player core
[[Category:Advanced topics]]
* Automatically create a Bookmark with picture for every SceneMarker (might be usefull,
but commercial detection software can generate a lot of scenemarkers).

Revision as of 00:03, 8 July 2020

Home icon grey.png   ▶ Video library
▶ Live TV
▶ Edit decision list

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 Kodi just before the video is played. Examples of use include can be to skip commercials, cut out content inappropriate for children, or skip over the half hour acid trip in 2001: A Space Odyssey .

Inspiration for this functionality came from MPlayer EDL support.

The internal video player (VideoPlayer) used by Kodi supports the following types of edits:

  • Cut - 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.
  • Mute - the audio is muted, video continues playing.
  • Scene Marker - these can be used to seek to points of interest within a video similar to how chapter seeking works for DVDs.
  • Commercial Break - each commercial break is automatically skipped once during playback. Since commercial detection is rarely 100% accurate, commercial breaks that have already been skipped can be re-entered by seeking backwards or rewinding. If an incorrectly flagged commercial break is automatically skipped, pressing (big skip backwards) within 10 seconds will jump back to the start of the commercial break. Pressing (big skip forward) within a flagged commercial break will go to the end of the commercial break.


Note: If using actual .EDL files the following field must be added to comskip.ini:

edl_skip_field=3

By default this value will be 0 in Comskip, and Kodi will see them as Cut actions and remove the section from the video (i.e. a 30 minute video would appear as 22 minutes with commericals removed). Setting this value overrides this behaviour allowing Kodi to treat it as a Commercial Break.

With edl_skip_field=3 , the full video file is visible, but Kdoi will skip the marked commercials the first time it attempts to play them. If, after commercials are skipped, you skip back through the recording (into a commercial area), you can then watch the video that was marked as a commercial.

(thanks sbthomas for the solution)


Supported File Formats

Kodi 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 Kodi 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)


MPlayer EDL

Classic MPlayer EDL files are supported. Kodi also supports an extended version of this file format that allows extra functionality as outlined below. The name of the file must be the same as the video file 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 time] [end time] [action]

Start and end times can be defined as seconds, HH:MM:SS.sss, or frames. To specify frames precede the frame number with the # symbol. The original MPlayer EDL files only support seconds for start and end times.

The actions supported by this file format have also been extended by Kodi to include Scene Marker and Commercial Break actions since the original format only supports Cut and Mute. Supported actions are:

  • 0 - Cut
  • 1 - Mute
  • 2 - Scene Marker (if start and end times are specified, the end time is used)
  • 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, 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
720.1        2

The following .edl file content will skip from frame 127 to frame 170, mute at frame 360, unmute at frame 400, and commercial skip from frame 10080 to frame 19728. There will be two scene markers. The first at frame 6127 and the next at frame 17282. Note that when using frame numbers TS files are not supported, other file formats that correctly provide frame rate will work.

#127   #170    0
#360   #400    1
#10080 #19728  3
#1     #6127   2
#17282         2

The following .edl file content will skip from second 5.3 to second 7.1, mute at 15 seconds, unmute at 16.7 seconds, and commercial skip from 7 minutes to 13 minutes and 42 seconds. There will be two scene markers. The first at 4 minutes and 15.3 seconds and the next at 12 minutes and 0.1 seconds.

5.3     7.1     0
15      16.7    1
7:00    13:42   3
1       4:15.3  2
12:00.1         2

Seconds and HH:MM:SS.sss can be accurately specified to three decimal places. Currently EDL cuts and mutes are frame accurate when specifying frames. Frames are specified inclusive (specify first frame to cut and last frame to cut).


Future.png FUTURE Matrix FEATURE:
In Kodi v19, the addition of handling a comment line has been added. These lines are defined as beginning with ##
Kodi will ignore any lines beginning with ## and continue processing the EDL file.

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

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. Note that for TS files only the version 2 format is supported (where frame rate is suppplied).

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>


Merging or Removing Short Commercial Breaks

The <edl> section of advancedsettings.xml can be used to:

  • Merge commercial breaks within a set of commercials that haven't been detected accurately. Very useful if you find that automatically skipped commercial breaks still end up within a set of commercial breaks.
  • Remove commercial breaks that are incorrectly identified outside of a likely set of commercial breaks. Very useful if you find that commercial skipping is happening unexpectedly while watching the TV show or Movie.

Altering Automatic Skip Timings

The <edl> section of advancedsettings.xml also can be used to:

  • Set how long to wait before automatically skipping when the start of a commercial break is reached. Useful if the automatic skip at the start of a set of commercial breaks is happening slightly too early for your liking, particularly if you aren't ever quite sure if that was a commercial that was about to start.
  • Set how long to rewind after automatically skipping to the end of the commercial break. Useful if it's kind of hard to tell if that was in fact the start of the TV show after a block of commercials.

Showing EDL Information During Playback

Display of EDL information was removed for v17 and v18 with the redesign of the Codec information windows.

Future.png FUTURE Matrix FEATURE:
EDL markers will be visible on the video player OSD. See PR15767


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.