Difference between revisions of "Edit decision list"
(→Comskip: FPS in the example file was wrong, it has a factor of 100)
(→Comskip: FPS in the example file was wrong, it has a factor of 100)
Latest revision as of 21:35, 9 January 2022
| Video library
|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. Note: Scene Markers are placed at the start and end of each commercial break so you can easily jump between the start and end of commbreaks using Scene Marker's builtin actions (NextScene and PreviousScene)
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)
1 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.
- The Matrix.Vprj (VideoReDo)
- The Matrix.edl (MPlayer EDL)
- The Matrix.txt (Comskip)
- The Matrix.avi.chapters.xml (SnapStream BeyondTV)
1.1 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 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 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. The file format is:
<Version>[only version 2 is supported] <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)
<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 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]
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 * 100] ------------------------ [start frame] [end frame]
FILE PROCESSING COMPLETE 678900 FRAMES AT 2500 ------------------------ 12693 17792 28578 34549 43114 48222
1.4 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. E.g. if you have a movie.mkv file, the corresponding EDL file should be named movie.mkv.chapters.xml
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>
<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>
2 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.
3 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.
4 Showing EDL Information During Playback
Display of EDL information was removed for v17 and v18 with the redesign of the Codec information windows.
|FUTURE Matrix FEATURE:|
EDL markers will be visible on the video player OSD. See PR15767
5 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.