XBMC Community Forum
EDL (and ComSkip) integration - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+--- Thread: EDL (and ComSkip) integration (/showthread.php?tid=27798)

Pages: 1 2 3 4 5 6


- DrDDT - 2007-08-09 01:02

The following code uses the edl option in mplayer when a 'moviename.edl' file is found.

Observations:
- The 'mute' function doesn't seem to work
- The 'skip' function works fine. You can still use the forward/back functions to see the skipped parts.

Here is the patch, hopefully using the correct format this time:

Code:
Index: mplayer.cpp

===================================================================

--- mplayer.cpp    (revision 9840)

+++ mplayer.cpp    (working copy)

@@ -122,6 +122,7 @@

   m_bLimitedHWAC3 = false;
   m_bDeinterlace = false;
   m_subcp = "";
+  m_strEdl = "";
   m_synccomp = 0.0f;
}
void CMPlayer::Options::SetFPS(float fFPS)
@@ -279,6 +280,11 @@

   m_iAutoSync = iAutoSync;
}

+void CMPlayer::Options::SetEdl(const string& strEdl)
+{
+  m_strEdl = strEdl;
+}
+
void CMPlayer::Options::GetOptions(int& argc, char* argv[])
{
   CStdString strTmp;
@@ -332,6 +338,12 @@

     }
   }

+  if (m_strEdl.length() > 0)
+  {
+    m_vecOptions.push_back("-edl");
+    m_vecOptions.push_back( m_strEdl.c_str());
+  }
+
   //MOVED TO mplayer.conf
   //Enable mplayer's internal highly accurate sleeping.
   //m_vecOptions.push_back("-softsleep");
@@ -858,6 +870,16 @@

     m_iPTS = 0;
     m_bPaused = false;

+    CStdString strEdlFileName;
+    if (!bFileOnInternet && bIsVideo && !bIsDVD )
+    {
+      CUtil::ReplaceExtension(strFile, ".edl", strEdlFileName);
+      if ( CFile::Exists(strEdlFileName) )
+      {
+        options.SetEdl(strEdlFileName);
+      }
+    }
+    
     // first init mplayer. This is needed 2 find out all information
     // like audio channels, fps etc
     load();
@@ -2051,4 +2073,4 @@

     m_evProcessDone.WaitMSec(1000);
     m_evProcessDone.WaitMSec(1000);
   }
-}

\ No newline at end of file

+}
Index: MPlayer.h

===================================================================

--- MPlayer.h    (revision 9840)

+++ MPlayer.h    (working copy)

@@ -61,6 +61,8 @@


     void SetAutoSync(int iAutoSync);

+    void SetEdl(const string& strEdl);
+
     void SetAudioOutput(const string& output) { m_videooutput = output; }
     void SetVideoOutput(const string& output) { m_audiooutput = output; }
     void SetAudioCodec(const string& codec) { m_videocodec = codec; }
@@ -94,6 +96,7 @@

     string m_demuxer;
     bool m_bDisableAO;
     string m_subcp;
+    string m_strEdl;
     string m_strChannelMapping;
     string m_strDvdDevice;
     string m_strFlipBiDiCharset;



- DrDDT - 2007-08-09 13:01

Would it be doable to show the EDL 'skip' parts when showing the movie play progress bar?
Maybe use a differen color, so if one shows the progress bar, you know where parts are going to be skipped?


- DrDDT - 2007-08-10 13:04

DrDDT Wrote:Would it be doable to show the EDL 'skip' parts when showing the movie play progress bar?
Maybe use a differen color, so if one shows the progress bar, you know where parts are going to be skipped?

Example of the progress bar I was thinking of.
Maybe also the miniature one in the top right of the screen, if it uses the same code.

[Image: screenshot001ys9.th.jpg]


- spiff - 2007-08-10 13:28

it does use the same code. however there's no such support as of yet.

patch welcome, i doubt any of the devs care (i for one do not). it would be rather tricky, as the progress bar is just generated based on info labels

i'll apply your submitted patch tonite unless elupus objects for some reason (cant see why)


- DrDDT - 2007-08-12 17:30

spiff Wrote:it does use the same code. however there's no such support as of yet.

patch welcome, i doubt any of the devs care (i for one do not). it would be rather tricky, as the progress bar is just generated based on info labels

i'll apply your submitted patch tonite unless elupus objects for some reason (cant see why)

Great! I see the patch is in.

Shouldn't we add this to the Wiki now?

Somewhere in this page?

http://xboxmediacenter.com/wiki/index.php?title=Videos


- spiff - 2007-08-12 17:31

go for it


- DrDDT - 2007-08-12 20:16

spiff Wrote:go for it

How about something like:

Code:
Edit Decision List

XBMC supports Edit Decision Lists.

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.

The current EDL file format is:
[begin second] [end second] [action]

Where the seconds are floating-point numbers and the action is either 0 for skip or 1 for mute. Example:

5.3   7.1    0
15    16.7   1
420   422    0

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.

To use an edl file with a video file, put it in the same folder as the video file.
The edl and video files must have the same name, for example:

Video File: The Matrix.avi
EDL: The Matrix.edl

This is a mix of wikipedia, the mplayer manual and the subtitles section.
Can I reference third party tools like comskip in the manual?


- spiff - 2007-08-12 20:32

sure. looks nice and informative to me


- jmarshall - 2007-08-13 00:57

Feel free to reference 3rd party stuff, sure. Best with just a link to the site so that if they change stuff that breaks what you write on the wiki it's not our problem Wink


- szsori - 2007-08-13 04:37

Are there publicly available EDL files for tv shows? Should there be?